SMTP Authorisation problems using Authenticator class..
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ramachandran_Sridhar
Posted On:   Monday, July 9, 2001 07:28 AM

Sir, I am facing a SMTP authorization related problem even though I have followed the procedures in the Java Mail API. The code snippet is as follows: // code begins.. Authenticator auth = new BIMAuthenticator(mailOption.username, mailOption.password); session = Session.getDefaultInstance(props, auth); session.setDebug(false); mimeMsg = makeMessage(session, ...); Transport transport = session.getTransport("smtp"); transport.connect(mailOption.outserver, mailOption.username, mailOption.password); mimeMsg.saveChanges(); transport.sendMessage(mimeMsg, mimeMsg.getAllRecipients());   More>>

Sir,


I am facing a SMTP authorization related problem even though I have followed the procedures in the Java Mail API. The code snippet is as follows:



// code begins..




			
Authenticator auth = new BIMAuthenticator(mailOption.username, mailOption.password);

session = Session.getDefaultInstance(props, auth);
session.setDebug(false);
mimeMsg = makeMessage(session, ...);

Transport transport = session.getTransport("smtp");

transport.connect(mailOption.outserver,
mailOption.username, mailOption.password);

mimeMsg.saveChanges();

transport.sendMessage(mimeMsg, mimeMsg.getAllRecipients());

transport.close();


// code ends



I get two different errors from two different mail servers:


Mail server 1:


*************


nested exception is:
javax.mail.SendFailedException: 550 Relaying is prohibited

at java.lang.Throwable. (Compiled Code)
at java.lang.Exception. (Compiled Code)
at javax.mail.MessagingException. (MessagingException.java:52)
at javax.mail.SendFailedException. (SendFailedException.java:73)
at com.sun.mail.smtp.SMTPTransport.rcptTo(Compiled Code)
at com.sun.mail.smtp.SMTPTransport.sendMessage(Compiled Code)
at moeza.mail.BIMInternetSendThread.run(BIMInternetSendThread.java:84)



Mail server 2


*************


javax.mail.SendFailedException: 473 sridhar_r90@rediffmail.com you should authenticate first



at java.lang.Throwable. (Compiled Code)
at java.lang.Exception. (Compiled Code)
at javax.mail.MessagingException. (MessagingException.java:39)
at javax.mail.SendFailedException. (SendFailedException.java:42)
at com.sun.mail.smtp.SMTPTransport.rcptTo(Compiled Code)
at com.sun.mail.smtp.SMTPTransport.sendMessage(Compiled Code)
at moeza.mail.BIMInternetSendThread.run(BIMInternetSendThread.java:91)




Is there any fool proof method to perform SMTP authorisation using javamail API?


Thanks a lot for your time..


Sridhar


   <<Less
About | Sitemap | Contact