Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to format the content of an email send with a form?

I have a complex HTML form which I want to send via email. Is there a way to send and format the content of this email as HTML via javascript without using a server-side script?

Edit: Lets assume there is a smtp server at hand to do the job.

like image 249
Thomas Avatar asked Oct 11 '22 19:10

Thomas


1 Answers

You can't send email from Javascript, so the obvious answer is no.

However, you can use the user's email client to send the email using the technique described in Sending emails with Javascript. Of course this allows the user opportunity to modify the email before it is sent, and it still requires an email server to accept the message, but it doesn't require you to write code that takes HTTP requests as input and sends email.

like image 111
Jon Avatar answered Nov 10 '22 07:11

Jon