javax.mail.MessagingException:501 5.5.1 HELO/EHLO需要域地址 [英] javax.mail.MessagingException: 501 5.5.1 HELO/EHLO requires domain address
本文介绍了javax.mail.MessagingException:501 5.5.1 HELO/EHLO需要域地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在本地主机上的Web应用程序(java/spring)应用程序成功发送电子邮件,但是当我 将其部署在主机上时出现以下错误:
My web app (java/spring) application in localhost sends email successfully but when i deploy it on host i got following error:
javax.mail.MessagingException: 501 5.5.1 HELO/EHLO requires domain address
我使用Java邮件库.
I use java mail library.
网络服务器:tomcat 7
web server: tomcat 7
谢谢.
推荐答案
经过大量的搜索后,我发现以下解决方法:
after a lot of googling i found the workaround below:
http://www.coderanch. com/t/271097/java/java/JavaMail-Exception-HELO-requires-domain
在创建会话以绕过先打招呼"错误时,我们应该添加以下道具:
we should add the following props when creating the session to bypass "send hello first" error:
props.put("mail.smtp.auth", "true")
props.put("mail.smtp.transport.protocol", "smtp");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.localhost", "127.0.0.1");
但这是一种解决方法,找不到根本原因.
but it is a workaround and the root cause is not found.
这篇关于javax.mail.MessagingException:501 5.5.1 HELO/EHLO需要域地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文