0 votes

I'm getting the same error when trying to render an email with 3 attachments with a total of 8MB.

related to an answer for: Out of memory when rendering eml
by (210 points)

1 Answer

0 votes

8MB of attachments is not a big message - Mail.dll should handle that just fine.

How does your code look like?

Can you create a sample project (possibly with test attachments) that reproduces this issue? Please zip it and send it directly to our support (you can find the address in the page footer).

I run a simple test just now:

MailBuilder builder = new MailBuilder();
builder.AddAttachment(new byte[3000000]);  // 3 MB
builder.AddAttachment(new byte[3000000]);  // 3 MB
builder.AddAttachment(new byte[3000000]);  // 3 MB
IMail mail = builder.Create();
byte[] eml = mail.Render();

File.WriteAllBytes("test.eml", eml);

It results in ~12MB email. Memory usage is nowhere near the amount that would cause OutOfMemoryException.

by (297k points)
edited by
...