Skip to content

Sending Attachments

Andrew Theken edited this page Dec 11, 2014 · 4 revisions

You may add file attachments to any outgoing email provided they comply with the current white-list of accepted email attachments.

var message = new PostmarkMessage();

message.To = "someone@someplace.com";
message.Cc = "someoneelse@someplace.com";
message.Subject = "Sending an attachment";
message.Textbody = "Some plain text";
message.From = "you@yourdomain.com";

message.AddAttachment(@"c:\temp\test.pdf", "application/pdf");

var newClient = new PostmarkClient("server_token");

var response = newClient.SendMessageAsync(message);

You may add as many attachments as you like as long as you don't go past the total size limit of 10MB.

Clone this wiki locally