Had the same thing when I switched from NT to Linux. Seems the 501 HELO error was a symptom of something else (at least for me). When I looked in the error logs I found a number of Java Bind Exceptions. These were due to some defunct Java processes hanging around from some previous invocations. I assume you're using Apache + Jserv or similar? Try running the following commands/etc/rc.d/init.d/httpd stop (stops apache) ps -ef | grep java (look for defunct processes) kill -9 xxxx (where xxxx is the process ID of ANY running java process from ps command: - kill them all!) /etc/rc.d/init.d/httpd start (starts apache again)The above worked for me. Note that restarting the box would have had the same effect, which you have probably done by now, anyway...
ESMTP Server可以接受不加参数的HELO命令啊……你的问题应该不在这个地方吧……
刚试了试,你们的ESMTP服务器确实要加参数才行……不过MS的是不用的……
To ender: It maybe can accept instruction without parameter. But I think our company's ESMTP must be set up to rejuct non-parameter instruction.To kuqi: your suggestion indicates that restarting the http server maybe give some help. But I think it's no help. I can sure that it ESMTP server's problem, because I telnet to my server, port 25, and write HELO command directly, It also responds to me 501 XXXX...... So the ESMTP server must require the instruction HELO with some parameters.That's all. Thanks.
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. Starting with JavaMail 1.1.3, you may also set the mail.smtp.localhost property to the name you want to use for the HELO command.
hah. It's exactly I wanted. Kuqi, thank u for you warm-hearted help. I'll give my point to u. Can u introduce urself briefly? I make a decision to immigate to Canada and now is in process. Please feel free to contact with me. Also thanks to other peoples who help me a lot.
重载send的方法,加一个有参数的。我有好久没有用javamail开发了,不过我记得Transport这个类在调用send方法前是可以设置的,其实只要用SMTP协议,自己按照它的范式些个程序也很简单了
所以只有我该程序去适应它, 但如果我能找到这个地方, 我就不会拿来问了, 因为我看了所有的javamail的api doc, 没有像改HELO指令带什么参数的.
其实, 只要你拿着C, 你可以些个java出来, 又何必用别人的java呢.
smtp address是否放在hosts文件里和我这个问题没有关系.
我的系统是linux, redhat.
501 HELO error was a symptom of something else (at least for
me). When I looked in the error logs I found a number of Java
Bind Exceptions. These were due to some defunct Java processes
hanging around from some previous invocations. I assume you're
using Apache + Jserv or similar? Try running the following
commands/etc/rc.d/init.d/httpd stop (stops apache)
ps -ef | grep java (look for defunct processes)
kill -9 xxxx (where xxxx is the process ID of ANY
running java process from ps command: - kill them all!)
/etc/rc.d/init.d/httpd start (starts apache again)The above worked for me. Note that restarting the box would have
had the same effect, which you have probably done by now,
anyway...
But I think our company's ESMTP must be set up to rejuct non-parameter instruction.To kuqi: your suggestion indicates that restarting the http server maybe give some help. But I think it's no help. I can sure that it ESMTP server's problem, because I telnet to my server, port 25, and write HELO command directly, It also responds to me 501 XXXX......
So the ESMTP server must require the instruction HELO with some parameters.That's all. Thanks.
Wait a little bit.
Kuqi, thank u for you warm-hearted help. I'll give my point to u. Can u introduce urself briefly? I make a decision to immigate to Canada and now is in process. Please feel free to contact with me. Also thanks to other peoples who help me a lot.