The Mailtool: The Script's Code - Doc JavaScript | WebReference

The Mailtool: The Script's Code - Doc JavaScript


The Mailtool

The Script's Code

<HTML>
<HEAD>
	<TITLE>mailto: URL Script</TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
// POP UP A PREFORMATTED EMAIL MESSAGE WINDOW
function popupMessage() {
  // SET MESSAGE VALUES
  var to = "tomer@netscent.com";
  var cc = "yehuda@internet.com";
  var bcc = "tomer@internet.com";
  var subject = "Comments about your tips";
  var body = 
    "Tomer and Yehuda,\n\n\tI'd like to suggest the following improvements to your tips: \n" + 
    "\nFirst, ..." +
	"\nAlso, sometimes...." + 
    "\n\nSincerely,\n\n" + "Your faithful reader...";
  // BUILD MAIL MESSAGE COMPONENTS 
  var doc = "mailto:" + to + 
    "?cc=" + cc + 
    "&bcc=" + bcc + 
    "&subject=" + escape(subject) + 
    "&body=" + escape(body); 
  // POP UP EMAIL MESSAGE WINDOW
  window.location = doc;
}
// -->
</SCRIPT>
<FORM> 
<INPUT TYPE="button" NAME="Test" Value="Test mailto: URL" onClick="popupMessage()"> 
</FORM> 
</BODY>
</HTML>

Next: A Final Word

http://www.internet.com


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: October 9, 2000
Revised: October 9, 2000

URL: http://www.webreference.com/js/column70/9.html