AttachmentCollectionAdd Method (String) |
Adds the attachment from a file.
Namespace: MailBee.MimeAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public bool Add(
string filename
)
Public Function Add (
filename As String
) As Boolean
Parameters
- filename
- Type: SystemString
The absolute or relative path to the file which should be attached.
Return Value
Type:
Booleantrue if the attachment was successfully added to the collection; otherwise,
false.
Exceptions Examples This sample loads the message from .EML file and adds an attachment to this message.
using MailBee;
using MailBee.Mime;
MailMessage msg = new MailMessage();
msg.LoadMessage(@"C:\Docs\TestMail.eml");
msg.Attachments.Add(@"C:\Temp\my_photo.jpg");
Imports MailBee
Imports MailBee.Mime
Dim msg As New MailMessage
msg.LoadMessage("C:\Docs\TestMail.eml")
msg.Attachments.Add("C:\Temp\my_photo.jpg")
See Also