PowerTCP Mail for .NET
Send(Stream,String,String,TransferEncoding) Method




Stream containing an encoded email message.
Address to use for "MAIL FROM". This can be generated using MailAddress.ToString().
Addresses to use for "RCPT TO". This can be generated using MailAddressCollection.ToString().
Restricted to TransferEncoding.SevenBit, TransferEncoding.EightBit and TransferEncoding.Binary, controls the use of the BODY label when sending an 8-bit encoded message.
Send a previously encoded message to a mail server, using from and recipients for constructing the SMTP envelope.
Syntax
Public Overloads Function Send( _
   ByVal encodedMessage As Stream, _
   ByVal fromAddress As String, _
   ByVal recipientAddresses As String, _
   ByVal bitEncoding As TransferEncoding _
) As SmtpResult
Dim instance As Smtp
Dim encodedMessage As Stream
Dim fromAddress As String
Dim recipientAddresses As String
Dim bitEncoding As TransferEncoding
Dim value As SmtpResult
 
value = instance.Send(encodedMessage, fromAddress, recipientAddresses, bitEncoding)

Parameters

encodedMessage
Stream containing an encoded email message.
fromAddress
Address to use for "MAIL FROM". This can be generated using MailAddress.ToString().
recipientAddresses
Addresses to use for "RCPT TO". This can be generated using MailAddressCollection.ToString().
bitEncoding
Restricted to TransferEncoding.SevenBit, TransferEncoding.EightBit and TransferEncoding.Binary, controls the use of the BODY label when sending an 8-bit encoded message.

Return Value

An SmtpResult object that describes the sent message.
Exceptions
ExceptionDescription
ProtocolExceptionBad SMTP protocol response received from server.
System.Net.Sockets.SocketExceptionA socket failure.
System.InvalidOperationExceptionThe bitEncoding parameter is TransferEncoding.EightBit or TransferEncoding.Binary and the server does not advertise 8bit or binary transport.
System.FormatExceptionBad address format.
System.ArgumentExceptionThe bitEncoding parameter is not TransferEncoding.SevenBit, TransferEncoding.EightBit or TransferEncoding.Binary.
Remarks

This method is identical to Send(MailMessage,String,String), except the message has already been encoded.

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(MailMessage,String,String) to send MailMessage using the specified envelope.

If an email address domain name contains non-ASCII characters, System.Globalization.IdnMapping.GetAscii(System.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