File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Email send failure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Email send failure" Watch "Email send failure" New topic

Email send failure

ahmed yehia
Ranch Hand

Joined: Apr 22, 2006
Posts: 424
I have got this exception while trying to run my application which suppose to send email message:

javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 550 Authentication require
d. Help at (failed to find host name f
rom IP address)

at com.sun.mail.smtp.SMTPTransport.rcptTo(
at com.sun.mail.smtp.SMTPTransport.sendMessage(
at javax.mail.Transport.send0(
at javax.mail.Transport.send(
at Reminder.sendMessage(
at Reminder.main(
Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 550 Authentication requ
ired. Help at (failed to find host nam
e from IP address)

at com.sun.mail.smtp.SMTPTransport.rcptTo(
... 5 more

my code is as follows:

[ April 03, 2007: Message edited by: A Yehia ]
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

550 Authentication required. Help at (failed to find host name from IP address)

This is your cause. You need authenticated to send mail.

Try the code below, instead of Transport.send()

[ April 03, 2007: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
ahmed yehia
Ranch Hand

Joined: Apr 22, 2006
Posts: 424
I ve got this exception after reformating my code:

javax.mail.NoSuchProviderException: No provider for
at javax.mail.Session.getProvider(
at javax.mail.Session.getTransport(
at javax.mail.Session.getTransport(
at Reminder.sendMessage(
at Reminder.main(


try {
String smtp = "";
Properties props = System.getProperties();
props.put("", smtp);
Session session = Session.getDefaultInstance(props, null);
MimeMessage message = new MimeMessage(session);
message.setFrom( new InternetAddress(""));
new InternetAddress(""));
message.setText("Body Text");
Transport t = session.getTransport(smtp);
try {
t.connect("username", "password");
t.sendMessage(message, message.getAllRecipients());
} catch (Exception e) { }
finally {
} catch (Exception e){
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

If you click on the link in your previous error message,, you get a page that tells you how to configure various email clients to use Earthlink SMTP, including the correct name for the SMTP server.

[How To Ask Questions On JavaRanch]
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
String smtp = "";
Properties props = System.getProperties();
props.put("", smtp);

You need to provide the mail server, which might be something like or or some such. Consult the Earthlink documentation or online help to find what you need to put in there.
Sirish Kumar Gongal Reddy
Ranch Hand

Joined: Oct 25, 2004
Posts: 109

Before using your SMTP address try to ping that from command prompt if it's valid you will get reply from ping commnad.

I agree. Here's the link:
subject: Email send failure
It's not a secret anymore!