Click here to Skip to main content
15,884,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am trying to send mail through java code.
getting this error

Mail Sending Failed in CASEID 00015063
with SUBJECT at
RESPONSE 3078CD0006626 - PROCESSED
REASON javax.mail.MessagingException: A1 BAD Invalid SASL argument. t21mb170186760ivm;
nested exception is:
com.sun.mail.iap.BadCommandException: A1 BAD Invalid SASL argument. t21mb170186760ivm

What I have tried:

Properties props = new Properties();
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.socketFactory.port", "465");
props.put("mail.smtp.socketFactory.class","javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", "465");
Posted
Updated 27-Mar-18 23:38pm

1 solution

See What are some of the most common mistakes people make when using JavaMail?[^]:
Quote:
Setting various socketFactory properties. Long, long ago JavaMail didn't have built in support for SSL connections, so it was necessary to set these properties to use SSL. This hasn't been the case for years; remove these properties and simplify your code. The easiest way to enable SSL support in current versions of JavaMail is to set the property "mail.smtp.ssl.enable" to "true".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900