Sending mail from javascript

I am developing a static website where I want to send an email when I click the "Send Button" button. IF possible, it would be nice if you could share the code

thank

+3
source share
5 answers

short answer: No!

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

+4
source

In short: Forget about it.

, . JavaScript, Ajax / SSJS.

+3

, -)

<input type="submit" value="Send" onclick="window.location ='mailto:email@address.com' "/>
+3

Javascript, , PHP, POST mail().

+1

Sorry, but with a static site you cannot do this. One possible option would be to create very complex javascript code to access one webmail account that you have, log in there and send an email using this account for you. It is theoretically possible, but I have never seen anything like it ...

0
source

Source: https://habr.com/ru/post/1786660/


All Articles