www.softwareriviera.com
Software Code
    New Code     Most Interesting     Don't Miss     Our picks  
HTML - section

View Article
Mailto
Mailto forms - sending emails
You can use an HTML form with a 'mailto' action in your page to send an email with some information to you or someone else. Please note that this will not always work on all combinations of email clients and browsers.

The following HTML code can be used
<form enctype="text/plain" method="get" action="mailto:youremail@yahoo.com">
Name 1: <input type="text" name="name_1">
<br/>
Name 2: <input type="text" name="name_2">
<br/>
<input type="submit" value= "Send It">
</form>
Notice that you should consider two things in this code:
- you should use the enctype=\"text/plain\" attribute. This will remove most of the HTTP encoding like pluses (+) instead of spaces.
- you should the GET method because the POST method usually causes the browser to open a blank email window.

Using the following PHP Mailto code you can control what will apear in your subject and body elements in the email:
echo "<form enctype=\"text/plain\" method=\"get\" action=\"mailto:youremail@yahoo.com\">";
echo "<input type=\"hidden\" name=\"subject\" value=\"".$theSubject."\">";
echo "<input type=\"hidden\" name=\"body\" value=\"".$emailBody."\">";
echo "<input type='image' src='".$email_Image."' alt='Send using email' border='0'>";
echo "</form>";
Date: 2008-2-14    Written by: Admin A
     See all articles in this section
Copyright © 2007-2009 SoftwareRiviera.com. All rights reserved.  | Terms of use | Disclaimer | Privacy Policy |