Jump to content

Archived

This topic is now archived and is closed to further replies.

rajmohan

Through JAVASCRIPT can we send MAIL??

Recommended Posts

Hello guy

i am my friend discussed about javascript : the topic is whether can we send mail through javascript

i told that it is possible. BUT my friend told that it is not possible

I need the correct solution for this one and coding also please help me

Share this post


Link to post
Share on other sites
AFAIK javascript doesnt have that sort of ability. Javascript runs on the client and can only do client side operations, so it cannot talk to the server to send an email from the local mail server that might be installed. If you want to send an email from your site you'll want to use a server side programming langauge in order to send an email, such as PHP and use the built in mail function - provided you have a local SMTP server installed and PHP is setup to use that SMTP server.

Or your friend might be getting his wires crosed with jsp, which is a server side version of javascript. Which I belive can send emails.

Share this post


Link to post
Share on other sites


<!-- Begin
function isPPC() {
if (navigator.appVersion.indexOf("PPC") != -1) return true;
else return false;
}
if(isPPC()) {
document.write('<b>Send <A CLASS="contact" HREF=\"mailto:\?subject\=Take a look at this page I found, ' + document.title + '?body=You can see this page at: ' + window.location + '\" onMouseOver="window.status=\'Send your friends e-mail about this page\'; return true" TITLE="Send your friends e-mail about this page">this page<\/A> to a friend</b>');
}
else { document.write('<b>Send <A CLASS="contact" HREF=\"mailto:\?body\=Take a look at this page I found, ' + document.title + '. You can see this page at: ' + window.location + '\" onMouseOver="window.status=\'Send your friends e-mail about this page\'; return true" TITLE="Send your friends e-mail about this page">this page<\/A> to a friend</b>');
}
//  End -->



then what is the use of this one whether this coding will send mail please tell me i dont know

Share this post


Link to post
Share on other sites
That is not sending the mail. What that does is opens up your email client, eg Outlook Express, Thunderbird or what ever your email client is. It is then down to you to send the email yourself by clicking the Send button in your email client. Plus its not javascript either. Its actually to do with the [b]mailto:[/b] protocol for your link. You're using javascript to populate the email subject and the body of the email.

Share this post


Link to post
Share on other sites
So only through outlook we can send mail right.

like php we cannot send mail in javascript right???

Share this post


Link to post
Share on other sites
No the mail: protocol will open up your defualt email client. You send you email through that. PHP on the other hand uses an SMTP server to send the email when you use the mail function.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.