2

I am developing a static website where in i want to send an email when HTML "Send Button" is clicked. IF it is possible it would be nice if u can share the code

Thanks

5 Answers 5

4

short answer: No!

Long answer: No, you can't send emails from static pages even using javascript. What you can do is to use ajax to send email from your html form.

Sign up to request clarification or add additional context in comments.

Comments

3

It is possible ;-)

<input type="submit" value="Send" onclick="window.location ='mailto:[email protected]' "/>

Comments

3

In short: Forget it.

If you want to send email with the slightest resemblance of reliability, use a server side process. If you want to use JavaScript then you can use Ajax to pass the data to that server side process and/or SSJS.

Comments

1

It is not possible to send email from Javascript, you'll need to write a page in a language like PHP to receive the POST data and use the mail() command there.

Comments

0

I'm sorry but just with a static website you can't do it. One imaginable possibility would be make a very complex javascript code to access one webmail account you have, login there and send the email using this account to you. It's theoretically possible, but I've never seen something like it...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.