Sends the RCPT command.
null or an empty String.
The RCPT command follows the MAIL command, and tells the SMTP server one of the recipients of the current message. The RCPT command may be repeated multiple times to tell the SMTP server of multiple recipients.
The RcptTo method takes the recipient email address
as a required parameter, and a list of RCPT command parameters as
an optional parameter. The recipient string
should be a simple email address in the form "jdoe@example.org".
The parameters string should contain the RCPT
command parameters as they would be sent in the RCPT command line.
parameters may be null or an empty
string.
String recipient = "jdoe@example.org";
smtpClient.RcptTo(recipient, null);
After the method returns, you should check the server's reply code, available as the ReplyCode property. A 250 or 251 reply code indicates success.
Note: The "recipient" is considered part of the SMTP envelope, and may be different from the "To" or "Cc" header fields of the actual message. The SMTP envelope recipient is associated with message delivery, indicating an address ("forward path") for final mail delivery.
| Exception Type | Condition |
|---|---|
| Exception | If a network or protocol error occurs. |
SmtpClient Class | Hunny.Mail Namespace | RCPT command in the SMTP specification