Open up a mail client application or use the browser's built in mail client to send a message to the indicated recipient.
Netscape supports the predefiniton of the Subject:, Cc: and Bcc: fields in the mailto: URL. This is illustrated in the example. This may not work on other browsers or JavaScript capable mail clients.
Note that you can leave the spaces as they don't need to be escaped in the Subject text. In some versions, you can also define the Body text for the email by appending the Body operator. This is also shown in the example.
This is only allowed under script control if the script has the UniversalSendMail privilege.
<!-- Simple example showing just a mail to link --> <a href="mailto:someone@somewhere.com">Send Mail</a> <!-- Adding a subject header --> <a href="mailto:someone@somewhere.com?Subject=Email From Link&Cc=access@wrox.com&Bcc=backup@wrox.com">Send Mail</a> <!-- Adding a subject header --> <a href="mailto:someone@somewhere.com?Subject=Email From Link">Send Mail</a> <!-- Adding CC and BCC fields --> <a href="mailto:someone@somewhere.com?Subject=Email From Link">Send Mail</a> <!-- Adding a predefined message body --> <a href="mailto:someone@somewhere.com?Subject=Email From Link&Cc=access@wrox.com&Bcc=backup@wrox.com&Body=messageText">Send Mail</a>
See also: | javascript: URL, mailbox: URL, nethelp: URL, UniversalSendMail, URL |
Prev | Home | Next |
mailbox: URL | Up | main() function |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |