Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

exception while sending mail using javamail

843830Aug 21 2004 — edited Jan 17 2006
below i am using the code to send a mail to xxxx@yahoo.com
but it is giving exception
"class com.sun.mail.smtp.SMTPSendFailedException: 554 <shatyak@yahoo.com>: Recipient address rejected: Relay access denied"

please can any body help me to solve this problem


Properties props = new Properties();
props.put("mail.smtp.host", "xxxxxxxxxxxxx");
Session s = Session.getInstance(props,null);

MimeMessage message = new MimeMessage(s);

InternetAddress from = new InternetAddress("sonee_sb@yahoo.com");
message.setFrom(from);
InternetAddress to = new InternetAddress("shatyak@yahoo.com");
message.addRecipient(Message.RecipientType.TO, to);

message.setSubject("Test from JavaMail.");
message.setText("Hello from JavaMail!");

Transport.send(message);



Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 14 2006
Added on Aug 21 2004
4 comments
1,793 views