+1 vote

Hello, I would like to see if there is an example of how I could change the content of a pdf attachment

by

1 Answer

0 votes

Emails are generally immutable (think about digital signatures for example).

You can of course change the content of any attachment. Simply set the MimeData.Data property.

Here's a sample code:

var builder = new MailBuilder();
builder.AddAttachment(new byte[] {1, 2, 3});
IMail email = builder.Create();

email.Attachments[0].Data = new byte[] {3, 4, 5};

email.Save("c:\\test.eml");

If you want to do that on the IMAP server, you'll have to delete old email and upload new one.

IMAP doesn't allow to replace existing emails. Not sure if you are asking about this though.

by (297k points)
...