javamail诡异的504异常

来源:互联网 发布:excel数据丢失 编辑:程序博客网 时间:2024/05/23 15:42
DEBUG: setDebug: JavaMail version 1.4.1
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtp.XX.com", port 25, isSSL false
220 ent-as1 smtp
DEBUG SMTP: connected to host "smtp.XX.com", port: 25


EHLO
504 this command is not implemented.
HELO
504 this command is not implemented.

邮件发送错误:504 this command is not implemented.

报错信息如上

在命令EHLO后面没有主机名


查看hostname

# hostname
XX-mail

查看host文件

# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain

将hostname "XX-mail" 写入到hosts里 邮件正常 发送

# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain XX-mail


参考文章http://blog.csdn.net/james05y/article/details/1624629#comments

原创粉丝点击