SMTP server wants a HostName after EHLO command

Feb 10, 2013 at 5:24 PM
Hello Higty, doomo arigato for this great project.

I've played with the SampleApplication and I've found out that my SMTP server requires to be called by its name after HELO.

Message : 501 Syntax: EHLO hostname and 501 syntax: HELO hostname

(I use AuthenticateMode = SmtpAuthenticateMode.None, Tls = false and port 25)

so I had to set:
cl.HostName = cl.ServerName
and everything seems to work fine, but I'm note sure if that's the clean way to do it?

Strange enough, I can set any non-empty value for HostName name and it seems to be happy

Should'nt we get the HostName from the initial 220 server response and send it back after HELO ?

Thanks for clarifying the usage of the HostName property.
Coordinator
Feb 11, 2013 at 12:37 AM
Edited Feb 11, 2013 at 12:38 AM
Arigatougozaimasu (^^)
---quote start----
Strange enough, I can set any non-empty value for HostName name and it seems to be happy
Should'nt we get the HostName from the initial 220 server response and send it back after HELO ?
---quote end----
It depends on a spec of your smtp server.
There is no specification about EHLO,HELO command in smtp rfc.
Probably it is no problem if you had no problem.

sincerely
Feb 11, 2013 at 8:02 AM
Oyaho gozaimasu.

You are correct, I've tested with 5 different smtp servers and they all behave differently.

It seems that the most widely accepted syntax it to just repeat the the initial server name after HELO.
That works with every SMTP server I've tested included gmail and live.

So maybe you might set HostName = ServerName in the constructor by default, rather than just the empty string.

Anyway, once you know it, it's easy to do. Thanks for the good job
Coordinator
Feb 13, 2013 at 5:06 AM
I'll change default value of HostName propety to "localhost" in next release.
It may solve your (and other's) problem.

Thank you for your comment.
Coordinator
Feb 26, 2013 at 11:36 PM
Hi.
I fixed it in latest release.