One ODM server reported an error authentication unsuccessful when sending e-mail with JavaMail, and others were normal
The solution is as follows
Javamailsenderimpl authentication exception: javax.mail.authenticationfailedexception: failed to connect,
open the debug log of JavaMail through properties.setproperty (“mail. Debug”, “true”); You can see that there is a problem of 535.7.3 authentication unsuccessful. You need to add the following settings:
properties.put (“mail. SMTP. Auth”, “true”)
properties.put(“mail.smtp.auth.mechanisms”, “NTLM”);
if it is not a Windows operating system, you need to change NTLM to digest mode
Properties properties = new Properties();
properties.put(“mail.smtp.auth”, “true”);
properties.put(“mail.smtp.auth.mechanisms”, “NTLM”); // If not, change to digest and try
// properties.setproperty (“mail. SMTP. Socketfactory. Class”, “javax. Net. SSL. Sslsocketfactory”)
properties.setProperty(“mail.debug”, “true”);
senderImpl.setJavaMailProperties(properties);
senderimpl.sethost (“IP address”)
senderimpl.setuser name (“authenticated user mailbox”)
senderimpl.setpassword (“corresponding email password”)
//senderImpl.setPort(25);
MimeMessage mailMessage = senderImpl.createMimeMessage();
MimeMessageHelper messageHelper = new MimeMessageHelper(mailMessage,
true, “GBK”);
Similar Posts:
- JavaMail uses 163 mailbox to report 535 error: authentication failed
- Phpmailer’s solution to extension missing: OpenSSL error
- javax.mail.MessagingException: Could not convert socket to TLS
- [mailbox usage] POP3, SMTP activation and setting method of Yahoo mailbox
- [Solved] Python Error: CentOS failed to send mail without any error message
- [773]smtplib.SMTPServerDisconnected: Connection unexpectedly closed
- Python Send Email Error: smtplib.SMTPException: SMTP AUTH extension not supported by server
- Trouble Connecting to sql server Login failed. “The login is from an untrusted domain and cannot be used with Windows authentication”
- Laravel [1045] Solution Access denied for user’homestead’@’localhost’
- Authenticate/Decrypt packet error: packet HMAC authentication failed