Reputation: 10669
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.
Upvotes: 5
Views: 2659
Reputation: 437554
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.
Upvotes: 3
Reputation: 20026
Why not just publish the form on your website and send a link?
Upvotes: 0
Reputation: 719
in order to send an email you have to connect to an SMTP server, now this kind of connection you would like to make through the server for few reasons:
other then that i do not know if there's a way to do this but i'll be rather surprised to hear of such a thing. good luck
Upvotes: 1