How do I send email with JavaScript without opening the mail client?

后端 未结 7 1829
遇见更好的自我
遇见更好的自我 2020-12-03 10:26

I\'m writing a HTML page with a registration button that should just silently send an email without opening the local mail client. Here is my HTML:

7条回答
  •  自闭症患者
    2020-12-03 11:03

    You need a server-side support to achieve this. Basically your form should be posted (AJAX is fine as well) to the server and that server should connect via SMTP to some mail provider and send that e-mail.

    Even if it was possible to send e-mails directly using JavaScript (that is from users computer), the user would still have to connect to some SMTP server (like gmail.com), provide SMTP credentials, etc. This is normally handled on the server-side (in your application), which knows these credentials.

提交回复
热议问题