Reputation: 31
So my question is when we use the following code:
<!DOCTYPE html>
<html>
<body>
<h3>Send e-mail to [email protected]:</h3>
<form action="MAILTO:[email protected]" method="post" enctype="text/plain">
Name:<br>
<input type="text" name="name" value="your name"><br>
E-mail:<br>
<input type="text" name="mail" value="your email"><br>
Comment:<br>
<input type="text" name="comment" value="your comment" size="50"><br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
</body>
</html>
What I'm asking is:
does this actually send an email to [email protected]? if so how?
Upvotes: 2
Views: 758
Reputation: 180
No, the browser fetches the default mail client. It does not automatically send the e-mail, it simply shorthands the process of opening the mail client and putting certain values such as addresses in the header.
Upvotes: 1
Reputation: 7076
No the browser is not capable of sending email. Usually a server side language, like PHP
or JAVA
is used to send the email. You can find scripts where you can send the data to and it will send an email for you.
Sending an email is a complicated task requiring ports
to be open and certain headers
to be sent with the message describing the To
, From
, Subject
, Body
, and more fields.
mailto
is a browser shortcut to enable links to be opened in the default client, that the user chooses.
Here's how you can send email using a PHP Script. If you do not have php on your server then you can not use this.
If you want to create an email template the mailto
supports a few more parameters that can be passed along. Here's an example. If you use javascript you can have the user fill in the form, then when they click submit have it open an email, in their default client (including web emails), and have it prefilled for them to click send.
Upvotes: 0