Hunny Software Library Reference

SmtpClient.Ehlo Method 

Sends the EHLO command.

[Visual Basic]
Public Sub Ehlo( _
   ByVal hostname As String _
)
[C#]
public void Ehlo(
   string hostname
);

Parameters

hostname
The hostname of the SMTP client.

Remarks

An SMTP client sends an EHLO command to identify itself to an SMTP server.

RFC 2821 requires that the hostname argument in the EHLO command be a fully qualified domain name or an IP address literal. (In practice, many SMTP servers ignore the hostname argument, regarding it as untrustworthy.)

After the method returns, you should check the server's reply code, available as the ReplyCode property. A 250 reply code indicates success.

Exceptions

Exception TypeCondition
ExceptionIf a network or protocol error occurs.

See Also

SmtpClient Class | Hunny.Mail Namespace | SmtpClient.Helo method | EHLO command in the SMTP specification