When sending out a single email salesforce encodes the HTML body

As per doc : https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_email_outbound_single.htm#apex_Messaging_SingleEmailMessage_setHtmlBody


Optional. The HTML version of the email, specified by the sender. The value is encoded according to the specification associated with the organization. You must specify a value for setTemplateId, setHtmlBody, or setPlainTextBody. Or, you can define both setHtmlBody and setPlainTextBody

Where is this setting in a dev org to control the type of encoding?


Here is what is documented under the Implementation Considerations by Salesforce:

The API supports either full Unicode characters or ISO-8859-1 characters. The character set for your organization depends on the Salesforce instance your organization uses. If your organization logs into ssl.salesforce.com, then your encoding is ISO-8859-1. All other instances use UTF-8. You can determine the character set for your organization by calling describeGlobal() and inspecting the encoding value returned in the DescribeGlobalResult.

  • Sounds like you don't have control but you do have visibility?
    – Adrian Larson
    Apr 23 '15 at 18:14
  • I saw that too, but wasn't sure if it was limited to API responses or was system wide. It wasn't totally clear from that document. Apr 23 '15 at 18:16
  • I went with this coz of this description on the encoding property of the DescribeGlobalResult "Specifies how an organization’s data is encoded" Looks like it represents the encoding for the org's data and not just APIs. Apr 23 '15 at 18:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.