Adding message attachments

Top  Previous  Next

You can add one or more attachments to an email message by invoking the AddAttachment method passing an Attachment instance as an argument. The Attachment instance can be constructed by passing a file path as an argument.

 

Note

 

Due to the way that the message body is copied when adding attachments it is important that attachments be added only after the body of the message has been defined. Changing the body, Content-Type, or Content-Transfer-Encoding of the message after attachments have been added may result in undesired effects.

 

 

Example

 

[C#]

Attachment a = new Attachment("c:\home\report.doc");

message.AddAttachment(a);

 

[Visual Basic]

Dim a As Attachment = Nothing

a = New Attachment("c:\home\report.doc")

message.AddAttachment(a)

 

 

 





Home | Company | Products | Solutions | Purchase | Support | Services | Blog

© 2021 JSCAPE LLC