JavaMail中的HELO名称无效 [英] Invalid HELO name in JavaMail

查看:535
本文介绍了JavaMail中的HELO名称无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用JavaMail发送邮件时,我收到以下错误。它是不寻常的,因为它一直工作到现在为止,没有任何改变。

I'm getting the following error when using JavaMail to send mails. Its unusual because its been working for sometime until now and no changes have been made.

 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1)
com.sun.mail.smtp.SMTPSendFailedException: 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1)

    at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
    at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)

我看了一下 RFC doc 但不知道如何将其意义翻译为JavaMail属性。

I have take a look at the RFC doc but unsre how to translate its meaning to the JavaMail properties.

任何想法为什么和任何解决方案都不胜感激。

Any ideas why and any solutions are appreciated.

推荐答案

从JavaMail API常见问题


问:尝试时收到MessagingException:501 HELO需要域名地址发送消息。
A:SMTP提供程序使用SMTP HELO命令中的InetAddress.getLocalHost()。getHostName()的结果。如果该呼叫未能返回任何数据,则在HELO命令中不会发送名称。检查您的JDK和名称服务器配置,以确保该调用返回正确的数据。您也可以将mail.smtp.localhost属性设置为要用于HELO命令的名称。

Q: I get "MessagingException: 501 HELO requires domain address" when trying to send a message. A: The SMTP provider uses the results of InetAddress.getLocalHost().getHostName() in the SMTP HELO command. If that call fails to return any data, no name is sent in the HELO command. Check your JDK and name server configuration to ensure that that call returns the correct data. You may also set the "mail.smtp.localhost" property to the name you want to use for the HELO command.

不是完全相同的错误消息,但这不应该为您的情况有所作为。

It's not the exact same error message but that shouldn't make a difference for your case.

所以只需确保将其设置为您的邮件服务器接受的东西。检查文档,配置或您的本地邮政主管,因为我不能告诉你这是什么。可能你只是发送被拒绝的localhost。尝试将其设置为实际解析为IP地址的主机名(如果可能)。

So just make sure to set it to something your mail server accepts. Check docs, config or your local postmaster as I can't tell you what that is. Probably you're just sending "localhost" which is denied. Try setting it to a hostname that actually resolves to your IP address (if possible).

这篇关于JavaMail中的HELO名称无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆