| 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.
| Exception | Description |
|---|---|
| Dart.PowerTCP.Mail.InvalidParameterTypeException | attachment is not a MimeAttachmentStream. |
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.
Target Platforms: Microsoft .NET Framework 2.0