It looks like JavaMail isn't able to figure out your host name correctly, although I don't know why it would think "????" is your host name. Set the mail.smtp.localhost property to the correct host name for your machine. See the javadocs for the com.sun.mail.smtp package for details.
Send mail to @hotmail.com/@live.com with JavaMail
-
01-07-2022 - |
Question
I develop a application on android to send email. I want to use account MSN to send mail but it not send and error code on debug as below:
My configure on property are:
systemProperty.put("mail.smtp.starttls.enable","true");
systemProperty.put("mail.smtp.auth", "true");
systemProperty.setProperty("mail.host", "smtp.live.com");
systemProperty.put("mail.smtp.port", "587");
The password and email address are correct and i ever test with other host are work except MSN.
Solution
OTHER TIPS
There seems nothing wrong with your configuration. 501 5.5.4 Invalid Address
can be occuring because of the possible reasons below
- The
To
email address is wrong in format (like check if it violates the possible combinations of email addresses. Eg., "My Name" - try simplifying it to myname@live.com and try - It might be bouncing email address
- Check the library you use for sending this, how and what it allows
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow