Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

send mail using javascript



5:34 am on Nov 30, 2001 (gmt 0)

Inactive Member
Account Expired


I would like to know the javascript code to send mail. I dont want to use the html tag <mailto> because it opens the default mail application like Outlook express et... Please help me
6:12 am on Nov 30, 2001 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
votes: 0

Here's a quote from O'Reilly's JavaScript:

A script cannot submit a form (using the submit() method of the Form object, for instance) to a mailto: or news: URL without the UniversalSendMail privilege or the user's explicit approval through a confirmation dialog. Such a form submission would contain the user's email address, which should not be made public without the user's permission.

In short, you're opening up a bag of complication by sending email with JavaScript. How about a simple CGI sendmail script? It's more univeral than JavaScript, and there are a host of good free scripts around.