This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes JMS - SendFailedException: 554 - Access denied ?! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JMS - SendFailedException: 554 - Access denied ?! " Watch "JMS - SendFailedException: 554 - Access denied ?! " New topic
Author

JMS - SendFailedException: 554 - Access denied ?!

Rasmeet Devji
Greenhorn

Joined: Dec 08, 2000
Posts: 17
Hi people,
The following is a piece of code, my first try on JavaMail API....
public class SendMail {
public static void main(String[] args) {
try {
String host = "smtp.vsnl.com";
String from = "rasmeet_d@yahoo.com";
String to = "sekhar_ks_us@yahoo.com";
// Get system properties
Properties props = System.getProperties();
// Setup mail server
props.put("mail.smtp.host", host);
// Get session
Session session = Session.getDefaultInstance(props, null);
// Define message
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
message.setSubject("Hello JavaMail");
message.setText("Welcome to JavaMail");
// Send message
System.out.println("Sending the message.......");
Transport.send(message);
System.out.println("Message sent..............");
}catch(Exception ex){
ex.printStackTrace();
}
}
}
The output -
Sending the message.......
Sending failed;
nested exception is:
javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
javax.mail.SendFailedException: 554 <rasmeet_d@yahoo.com>: Sender address rejected: Access denied
The mail ids here are valid and infact I also tried some other non-yahoo / hotmail ids, but it still does not work !!!
Any fixes to be done to the code ??
Regards.
Lakshmi Kishore
Ranch Hand

Joined: Aug 04, 2001
Posts: 51
hi,
i faced the same problem, but it worked if i give the "sender mail id server", means, if you are using yahoo mail id, try to give the yahoo server (may be pop3) name as host. then it will work.
i tried with my company server.


Thanks & Regards<br />glkishore
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JMS - SendFailedException: 554 - Access denied ?!
 
Similar Threads
JavaMail
What should be the value of 'host' when I send an e-mail?
i got problem with sending mail to yahoo using JavaMail API
excveption in mail api please help
Send Mail problem