Re: javax.mail.MessagingException: 505 Authentication required
Posted By:
Jari_Kanstren
Posted On:
Thursday, October 25, 2001 01:47 AM
Been meaning to look up on this myself. Here's something that might help you from Suns JavaMail FAQ. Let me know how it turns out for you...
http://java.sun.com/products/javamail/FAQ.html#send
Q: I need to authenticate to my SMTP server so I call trans.connect(host, user, password)and then trans.send(msg)to send the message, but it's not working.
A: You should call msg.saveChanges() and then trans.sendMessage(msg) to send the message.
As described above, the send method is a static convenience method that acquires its own Transport object and creates its own connection to use for sending; it does not use the connection associated with any Transport object through which it is invoked. And of course don't forget to set the mail.smtp.auth property to true to enable SMTP authentication!