class javax.mail.SendFailedException: 553 sorry
I have a java mail sending program which is showing the following problem.
javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
class javax.mail.SendFailedException: 553 sorry, Authentication failed or timed out. Please do get messages first to authentica
te yourself.(#4.4.3)
I had already used SMTP And POP Autenticator but the problem is same in both the case
I am aslo giving code below.
Properties props = new Properties();
props.put("mail.smtp.host", hostName);
Session session = Session.getInstance(props, null);
Message ms_msg = new MimeMessage(session);
InternetAddress from = new InternetAddress(strFrom);
ms_msg.setFrom(from);
InternetAddress address = new InternetAddress(astrTo);
ms_msg.setRecipient(Message.RecipientType.TO, address);
if(cc!=null && !cc.equalsIgnoreCase(""))
{
address = new InternetAddress(cc);
ms_msg.setRecipient(Message.RecipientType.CC, address);
}
ms_msg.setSubject(strSubject);
ms_msg.setContent(message,"text/plain");
Transport.send(ms_msg);
System.out.println("Email has been sent to:"+astrTo+"@@@@@@@@@@-##");
request.setAttribute("message", "Email has been Sent.");
Please help me, what could be a solution.

