Problem during sending email using JSP

Hi, i m trying to send mail using JSP. i have done it successfully when i use my companies mail server, and send an email to my company's email address. But when i was try to send email to my yahoo address (i.e. a_abbas77@yahoo.com) then i got javax.mail.SendFailedException : 550 5.7.1 unable to relay for a_abbas77@yahoo.com Can somebody help me to solve this problem . . . Thanks in advance . . . Aamir

hi aamir, i have done the same thing in my module.i think the code \below can help u.i have mad a class called mailer u can use the class.for using the class should download javamailapi,java activationframework in ur class path and continiue. the code is

Don't want to be unpleasant but have you considered reading the forum before you post? This topic was last discussed here less than a day ago. And with a subject like "sending an email from jsp" it should not have been that hard to find. - Peter

aamir abbas
Greenhorn

Joined: May 04, 2001
Posts: 19

posted May 05, 2001 03:31:00

0

Originally posted by KCVignesh:hi aamir, i have done the same thing in my module.i think the code \below can help u.i have mad a class called mailer u can use the class.for using the class should download javamailapi,java activationframework in ur class path and continiue. the code is

Hi Vignesh, Thanks for ur reply. actually i have successfully send mail using my companies mail server (say "abc.ubitec.com"). It works fine but only with my company's account, i.e. when i send an email to my ubitec account (aamirabbas@ubitec.com). The problem is that when i try to send email to my yahoo account it fails. . . i think problem is with my mail server . . . can i use any other server ??? i also try to use yahoo's nomail.yahoo.com server (someone tell me abt that) but when i use nomail.yahoo.com as smtp host then UnknownHost Exception is generated . . . plz guide me abt which mail server can i use . . .??? Waiting for ur reply . . . Aamir

Hi, do you use this code as a bean in a JSP page? But it does not look like a bean to me...

Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252

posted May 05, 2001 14:47:00

0

Oh well. Perhaps it wasn't clear. Here goes. Mail servers are generally happy to accept mail for users local to that server. But, with very rare and short-lived exceptions, they do not accept mail which would need to be transported (jargon: relayed) someplace else, except from a few privileged hosts. The reason that they don't - and the reason that exceptions are short-lived - is spam. Spammers love relaying hosts to send their tens of thousands of e-mails. A third party relay allows them to hide their origin. Their ISP is unlikely to take action against them, since it is a third party which gets to bear all of the load, and some hours later all of the complaints. Many a naive systems administrator has learnt that lesson the hard way. So that's your problem. You can forget about using an arbitrary mail host to relay your mail. It won't. You can stop trying the hosts people suggest to you. They won't work. You have to ask your company's systems administrator to allow their SMTP server(s) to relay for your machine, or register with an ISP or e-mail service provider. Full stop. HTH - Peter

[This message has been edited by Peter den Haan (edited May 05, 2001).]