Hunny Software Library Reference

SmtpClient.Helo Method 

Sends the HELO command.

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

Parameters

hostname
The hostname of the SMTP client.

Remarks

An SMTP client sends a HELO command to identify itself to an SMTP server. The HELO command is deprecated in current usage; it is replaced by the EHLO command. However, the HELO command is sometimes needed as a fallback in situations where an old SMTP server implementation does not recognize the EHLO command.

RFC 2821 requires that the hostname argument in the HELO 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.Ehlo method | HELO command in the SMTP specification