Dart.Mail Namespace > Smtp Class > Send Method : Send(MailMessage,String,String) Method |
Public Overloads Function Send( _ ByVal message As MailMessage, _ ByVal fromAddress As String, _ ByVal recipientAddresses As String _ ) As SmtpResult
Dim instance As Smtp Dim message As MailMessage Dim fromAddress As String Dim recipientAddresses As String Dim value As SmtpResult value = instance.Send(message, fromAddress, recipientAddresses)
public SmtpResult Send( MailMessage message, string fromAddress, string recipientAddresses )
public: SmtpResult* Send( MailMessage* message, string* fromAddress, string* recipientAddresses )
public: SmtpResult^ Send( MailMessage^ message, String^ fromAddress, String^ recipientAddresses )
Exception | Description |
---|---|
ProtocolException | Bad SMTP protocol response received from server. |
System.Net.Sockets.SocketException | A socket failure. |
System.InvalidOperationException | MailMessage.BitEncoding is TransferEncoding.EightBit or TransferEncoding.Binary and the server does not advertise 8bit or binary transport. |
System.FormatException | Bad address format. |
Send(MailMessage) constructs the SMTP envelope with values from From, To, Cc, and Bcc. This method overloads Send(MailMessage) with parameters that specify the "MAIL FROM" and "RCPT TO" SMTP command arguments. Initialize a MailMessage by doing the following:
Alternatively, use Send(String,String,String,String) to send a basic text message, Send(MailMessage) to use the mail addresses in the message, or Send(Stream,String,String) to send a previously encoded message (stream).
If an email address domain name contains non-ASCII characters, IdnMapping.GetAscii(String) will be used to convert it to a valid format.
This method automatically calls Connect and Authenticate if not connected to the server and SendDirectToMx is false.