Jump to content


Photo

Through JAVASCRIPT can we send MAIL??


  • Please log in to reply
8 replies to this topic

#1 rajmohan

rajmohan
  • Members
  • PipPipPip
  • Advanced Member
  • 169 posts

Posted 21 September 2006 - 08:52 AM

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

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 21 September 2006 - 09:44 AM

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.

#3 rajmohan

rajmohan
  • Members
  • PipPipPip
  • Advanced Member
  • 169 posts

Posted 21 September 2006 - 10:04 AM



<!-- 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

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 21 September 2006 - 10:24 AM

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 mailto: protocol for your link. You're using javascript to populate the email subject and the body of the email.

#5 rajmohan

rajmohan
  • Members
  • PipPipPip
  • Advanced Member
  • 169 posts

Posted 21 September 2006 - 10:32 AM

atleast we cannot able to send

sender name
to
message

in java script


#6 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 21 September 2006 - 10:34 AM

You'll have to add those bits in if you want to send them with the email.

#7 rajmohan

rajmohan
  • Members
  • PipPipPip
  • Advanced Member
  • 169 posts

Posted 21 September 2006 - 10:48 AM

So only through outlook we can send mail right.

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



#8 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 21 September 2006 - 11:51 AM

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.

#9 rajmohan

rajmohan
  • Members
  • PipPipPip
  • Advanced Member
  • 169 posts

Posted 21 September 2006 - 12:34 PM

Thank you very much




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users