We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Specify attachment ContentType

I need to specify the attachment type in a message I send via exchange

with SMTP I would use something like
myAttachment = New System.Net.Mail.Attachment(strCurAttachment, System.Net.Mime.MediaTypeNames.Application.Pdf)

how do I provide the contenttype for Aspose.Email.Attachment(strCurAttachment,???

@gavinduffy,

You may use the code snippet given below to add attachment type to attachments.

MailMessage mailMessage = new MailMessage("Email1", "Email2", "Test Email", "Test Email Body");
ContentType type = new ContentType();
type.MediaType = MediaTypeNames.Application.Pdf;
Attachment attachment = new Attachment("FileName", type);
mailMessage.AddAttachment(attachment);

We hope that this answered your question. If you have additional questions, please feel free to ask us.

thank you, that did it.