to send mail in javascript should work for all mail clients.

admin

Administrator
Staff member
Here I Have a problem where in I need to open the Email client and display subject in subject and body string in body of the mail and client mail client can be Outlook express, netscape messenger or OUTLOOK.

so I need this to work in all these mail clients. The code below works well with Outlook mail client,I have to get this code working in outlook express and netscape messenger.

<html>
<head>
<script>
function jsSendLink()
{
var sDocurl = "http://localhost/docs/1/test.htm";
var sShowtoc ="y";
if (sDocurl != "")
{
if (sShowtoc == "y")
{
var sSubject = "SQL Book";
}
else
{
//TODO TITLE tag
//alert(window.parent.document.title);
}
}
//else
//{

//}
window.location = "mailto:[email protected]&subject = " + sSubject + "&body=" + sDocurl ;

}
jsSendLink()
</script>
</head>
</html>
 
Back
Top