I've got a feedback HTML form, the results of which I need to send to an e-mail address. How do I do that in JavaScript?
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a limit to how many levels you can nest i
- Laravel Option Select - Default Issue
- How to toggle on Order in ReactJS
- void before promise syntax
its impossible :) but, you can use jQuery and backend application, written by python(django), php, asp.net, etc.
Simple jQuery script:
And PHP script:
its simple, without security fix.
Other than possibly AJAX I know of no other way.
EDIT: To clarify - AJAX would call another function like PHP to actually send the mail. You'd need to implement it serverside.
EDIT2: Here's an article
you have to use server side scripting like php or perl
send the form content to the server side php. write using sendmail function in php.
your content will be sent to that email.
You can't. You will need to use some sort of background technology, such as python, ruby, coldfusion, php or ASP in order to send it to your email.
There's a few free services on the nets that will allow you to do that using their own resources, but if you are dealing with secure information, you better use your own resources.
Here's a free PHP service that will allow you to do something like that, but just remember that this kind of service is normally unreliable.
You can not do that with pure javascript, you might want to use ajax for that too but yet behind the scenes there should be a server-side language to send the email.
If you want something that even comes close to working for a reasonable number of people then, keeping within the constraints of the question, you need to use server side JavaScript (the specifics depend on the particular implementation of SSJS you are using, see Whitebeam for an example).