devxlogo

Mailto Subject Changes

Mailto Subject Changes

It’s possible to create mailto links that include a subject line in addition to just the recipient’s e-mail address, however, not all e-mail programs support this functionality. That said, to create a new e-mail message with the subject and CC fields filled in you can use a URL formatted like this:

 mailto:[email protected]?subject=Information&[email protected]

To get the functionality you’re looking for, use JavaScript to assemble a URL like the one above from the user’s selections on the form. Then set the window’s location property to that URL. If this was a normal URL, the browser would display in the main window. However, because this is a mailto link, a new window is automatically opened for the e-mail message, while the current page remains visible.

 

devx-admin

Share the Post: