PowerTCP Mail for .NET
Send(MailMessage,String,String) Method




MailMessage representing an email message.
Address to use for "MAIL FROM". If null, uses From.
Addresses to use for "RCPT TO". If null, uses To, Cc, and Bcc.
Send a MailMessage to a mail server using from and recipients to construct the SMTP envelope instead of MailMessage properties.
Syntax
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)

Parameters

message
MailMessage representing an email message.
fromAddress
Address to use for "MAIL FROM". If null, uses From.
recipientAddresses
Addresses to use for "RCPT TO". If null, uses To, Cc, and Bcc.

Return Value

SmtpResult that describes the result.
Exceptions
ExceptionDescription
ProtocolExceptionBad SMTP protocol response received from server.
System.Net.Sockets.SocketExceptionA socket failure.
System.InvalidOperationExceptionMailMessage.BitEncoding is TransferEncoding.EightBit or TransferEncoding.Binary and the server does not advertise 8bit or binary transport.
System.FormatExceptionBad address format.
Remarks

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.

See Also

Reference

Smtp Class
Smtp Members
Overload List


PowerTCP Mail for .NET Documentation Version 4.3
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic