Sending Email

To help your applications send emails, the Force Platform provides a comprehensive set of built-in classes and methods that allow you to send either basic text-based messages or rich HTML messages with attachments through the use of Apex code.

Basics of Sending Email

You do not need to be an expert to get started sending emails from your Apex code. The SendEmail Apex class has been uploaded into your organization as part of the chapter setup; the methods within it are referenced throughout this section.

Before running the following code samples in this section, open your preferred Apex code editor and modify the value of the EMAIL_ADDRESS static variable in the sendMail class, as shown in the following code. Your email address ...

Get The Developer’s Guide to the Force.com Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.