java javax.mail.MessagingException:无法连接到 SMTP 主机:<主机名> 端口:25 响应:554

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5429766/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 11:04:43  来源:igfitidea点击:

javax.mail.MessagingException: Could not connect to SMTP host : <host name> port : 25 response: 554

javajakarta-eejavamail

提问by Sreekanth P

I am trying to send mail using java mail api. My smtp server is an ibm server. I am facing this exception

我正在尝试使用 java mail api 发送邮件。我的 smtp 服务器是 ibm 服务器。我正面临这个例外

javax.mail.MessagingException: Could not connect to SMTP host : <host name> port : 25 response: 554

pls help me.

请帮助我。

Thanks in advance.

提前致谢。

回答by Tomas Narros

You are getting an error code 554: Access Denied Relay.

您收到错误代码 554: Access Denied Relay

It can be caused because your SMTP server doesn't recognise your petition as legit, and blocks it as if it were SPAM.

这可能是因为您的 SMTP 服务器未将您的请愿书识别为合法的,并将其视为垃圾邮件而进行阻止。

Perhaps your from account doesn't match the server expected domain, or you need add some aditional autentication parameters to your SMTP connection (hard to know without more information on your code).

也许您的 from 帐户与服务器预期的域不匹配,或者您需要向 SMTP 连接添加一些额外的身份验证参数(如果没有关于您的代码的更多信息,就很难知道)。