Monday, March 19, 2012

HTML: Automatically Fill in Email Subject (mailto)

Example 1: <a> tag
<a href="mailto:emailname@yourdomain.com?subject=Subject You Selected&body=Body content">The text of your link</a>

Example 2: open new window in JavaScript
window.open('mailto:emailname@yourdomain.com?subject=Subject You Selected&body=Body content');

Example 3: <form> tag | (Demo)
<form action="mailto:you@yourdmainhere.com" method="post" enctype="text/plain">
FirstName:<input type="text" name="FirstName">
Email:<input type="text" name="Email">
<input type="submit" name="submit" value="Submit">
</form>

Refer site:
http://www.htmlbasictutor.ca/email-subject.htm
http://www.javascript-coder.com/javascript-form/javascript-email-form.phtml

1 comment: