PowerTCP Mail for .NET
Add(Stream,String) Method
See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace > Attachments Class > Add Method : Add(Stream,String) Method




attachment
The Stream to add to the collection.
fileName
The filename for the attachment.
Inserts the specified Stream (must be a MimeAttachmentStream) into the collection as an attachment.

Syntax

Visual Basic (Declaration) 
Public Overloads Function Add( _
   ByVal attachment As Stream, _
   ByVal fileName As String _
) As Integer
Visual Basic (Usage)Copy Code
Dim instance As Attachments
Dim attachment As Stream
Dim fileName As String
Dim value As Integer
 
value = instance.Add(attachment, fileName)
C# 
public int Add( 
   Stream attachment,
   string fileName
)
Managed Extensions for C++ 
public: int Add( 
   Stream* attachment,
   string* fileName
) 
C++/CLI 
public:
int Add( 
   Stream^ attachment,
   String^ fileName
) 

Parameters

attachment
The Stream to add to the collection.
fileName
The filename for the attachment.

Exceptions

ExceptionDescription
Dart.PowerTCP.Mail.InvalidParameterTypeExceptionattachment is not a MimeAttachmentStream.

Remarks

Use this method to add an Stream which is a MimeAttachmentStream (which represents a MIME attachment) to the Attachments collection. Since the Attachments collection actually reflects the MessageStream.Parts.Attachments collection, a new MimeAttachmentStream will be added to the MessageStream.Parts.Attachments collection and the Message.Attachments collection will reflect this. If any other type of Stream is added to the MessageStream.Attachments collection, an exception will be thrown.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.