This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes javax.mail.MessagingException: 501 5.1.7 Invalid address Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "javax.mail.MessagingException: 501 5.1.7 Invalid address" Watch "javax.mail.MessagingException: 501 5.1.7 Invalid address" New topic
Author

javax.mail.MessagingException: 501 5.1.7 Invalid address

Romeo Ranjan
Ranch Hand

Joined: Feb 23, 2009
Posts: 95
Hi All,

I am trying to send email from my code using java mail. Here is the code snippet



The exception that I get is


I understand that the SendFailedException for invalid address might occur if the address may not exists which is not true-its my company mail address that I use. There might be a invalid syntax-no problem withthe syntax of the address..

I am not able to figure out the reason for the issue..Can someone please help me?

Thanks




SCJP 6.0
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19693
    
  10

I would start with the obvious. You've provided an invalid address (either the "from" address, or one of the recipient addresses). So look at those addresses. Post them here if you don't see what's invalid about them.
 
Don't get me started about those stupid light bulbs.
 
subject: javax.mail.MessagingException: 501 5.1.7 Invalid address
 
It's not a secret anymore!