Sends the message as text lines.
The message follows the DATA command, if the DATA command
succeeds. In SMTP, the message is sent as a series of lines, where
each line ends with the CR LF characters. The bytes provided as an
argument to the SendLines method should be in the required
format -- that is, the buffers should contain lines of text.
(Remember that non-text data is converted to text by base64
encoding as required by the MIME specification.)
To send the message, call the SendLines method as
many times as you need to send all the bytes of the message. When
you call SendLines to send the first buffer, you must set
the SmtpClient.FIRST bit in the options
argument. When you send the last buffer, you must set the
SmtpClient.LAST bit in the options
argument.
SendLines performs the conversion to CR LF
end-of-line characters if you specify SmtpClient.CONVERT_EOL
as one of the options. With the SmtpClient.CONVERT_EOL
option set, conversions are performed as follows: LF --> CR LF,
and CR LF --> CR LF. Therefore, with the
SmtpClient.CONVERT_EOL option, you can safely submit text
with LF end-of-line characters or with CR LF end-of-line
characters.
The SmtpClient.LAST option is an indication to the
library code to receive a response from the server. You should
then check the reply code of the server's response, which is
available as the ReplyCode property. A
250 reply code indicates success.
| Exception Type | Condition |
|---|---|
| Exception | If a network or protocol error occurs. |
SmtpClient Class | Hunny.Mail Namespace