PowerTCP Mail for .NET
Save(Stream) Method




The System.IO.Stream that the message will be written to.
Encodes the MIME entity and saves it to the specified stream.
Syntax
Public Overloads Sub Save( _
   ByVal encodedStream As Stream _
) 
Dim instance As MailMessage
Dim encodedStream As Stream
 
instance.Save(encodedStream)
public void Save( 
   Stream encodedStream
)
public: void Save( 
   Stream* encodedStream
) 
public:
void Save( 
   Stream^ encodedStream
) 

Parameters

encodedStream
The System.IO.Stream that the message will be written to.
Exceptions
ExceptionDescription
System.UnauthorizedAccessExceptionThis usually indicates that an antivirus has quarantined or blocked access to a decoded attachment on disk. Set DecodeToMemory to true to decode attachments to memory instead of to disk to circumvent your antivirus. Alternatively, test each attachment with Attachment.Content.OpenRead() and remove any attachments that throw an exception.
System.IO.FileNotFoundExceptionThis usually indicates that an antivirus has quarantined or blocked access to a decoded attachment on disk. Set DecodeToMemory to true to decode attachments to memory instead of to disk to circumvent your antivirus. Alternatively, test each attachment with Attachment.Content.OpenRead() and remove any attachments that throw an exception.
Remarks

The caller is responsible for opening and closing encodedStream.

Saving a MailMessage with this method will include the Bcc field, which should not be included in messages sent to a server. To output the MailMessage as it would be sent to a server, use MailMessage.GetEncodingStream().

See Also

Reference

MailMessage Class
MailMessage Members
Overload List


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