exception while sending mail using javamail
843830Aug 21 2004 — edited Jan 17 2006below 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);