function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
LinThawLinThaw 

What is maximun size of setPlainTextBody?

Hi 

I am using Messaging.sendEmail method.
What is maximun size of setPlainTextBody?

Thanks & Regards,
LinThaw
Best Answer chosen by LinThaw
Sandeep WaliaSandeep Walia
Hi LinThaw,

The heap size of Email service is 36MB as given here (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm).
So if you are just sending an email that will only contain text body then it can contain 36,000,000  characters. But you might run into SMTP server limts which varies from email client to email client.
As per this article this (http://kb.mailchimp.com/delivery/deliverability-research/gmail-is-clipping-my-email) article Gmail clips the body if it is greater than 102KB.

Hope this helps,
Sandeep

All Answers

Sandeep WaliaSandeep Walia
Hi LinThaw,

The heap size of Email service is 36MB as given here (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm).
So if you are just sending an email that will only contain text body then it can contain 36,000,000  characters. But you might run into SMTP server limts which varies from email client to email client.
As per this article this (http://kb.mailchimp.com/delivery/deliverability-research/gmail-is-clipping-my-email) article Gmail clips the body if it is greater than 102KB.

Hope this helps,
Sandeep
This was selected as the best answer
LinThawLinThaw
Thanks Sandeep Walia