sending mail using javascript

O

Obscurr

hi

I'm would like my app to send a preformatted email(with subject and
body) everytime a user pushed a button, like : onclick "
mailto:[email protected]" , without the user seeing anything, i.e. not
being able to edit the message.

Using php, this is very simple; mail("(e-mail address removed)", "Subject",
"Line 1\nLine 2\nLine 3");

is there a way to do this the same, easy way using javascript?


obscurr
 
L

Lasse Reichstein Nielsen

I'm would like my app to send a preformatted email(with subject and
body) everytime a user pushed a button, like : onclick "
mailto:[email protected]" , without the user seeing anything, i.e. not
being able to edit the message.
is there a way to do this the same, easy way using javascript?

No. Plain Javascript has no networking ability besides what the
browser provides. You can make the browser fetch an URL, and that is
about it.

Using the mailto: protocol requires the user to have set up a mail
client, and will usually open that client for him to see and approve.

When you think about it, if what you want was possible, you could make
a page that sends spam mail every time someone visits it ... without
him even being aware.

/L
 
S

Stuart Palmer

Best way to do mailing is serverside as mailto loads up your default mail
client in browsers like NS and even worse message if you don't have a
default set up.
So, as I said, best way is server side.

Stu
 
H

Hywel Jenkins

hi

I'm would like my app to send a preformatted email(with subject and
body) everytime a user pushed a button, like : onclick "
mailto:[email protected]" , without the user seeing anything, i.e. not
being able to edit the message.

Using php, this is very simple; mail("(e-mail address removed)", "Subject",
"Line 1\nLine 2\nLine 3");

is there a way to do this the same, easy way using javascript?
Yes - do you have server-side JavaScript or ASP with JavaScript?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,082
Messages
2,570,587
Members
47,209
Latest member
Ingeborg61

Latest Threads

Top