+1 vote

Hi,

is there a way to get the byte[] of an IMail oder save it to a Stream. The IMail interfaces exposes a .Save(string fileName) Method only.

Thanks,
Philipp

by

1 Answer

0 votes
 
Best answer

Hi,

You can use one of the IMail's Render methods to save email to byte array or MemoryStream:

byte[] IMail.Render();
byte[] IMail.Render(AddressHeaderRenderMode bccRenderMode);
void IMail.Render(Stream stream);
void IMail.Render(Stream stream, AddressHeaderRenderMode bccRenderMode);
by (301k points)
...