Apex_mail.send

apex_mail.send is a method in Salesforce that allows you to send emails from your Apex code. Here's a brief overview:

Syntax:

ApexMail.send(String subject, String body, String[] recipients, String[] cc, String[] bcc, String fromName, String fromAddress);

Parameters:

  1. subject: The subject line of the email.
  2. body: The body of the email.
  3. recipients: An array of email addresses to send the email to.
  4. cc: An array of email addresses to send a carbon copy (CC) to.
  5. bcc: An array of email addresses to send a blind carbon copy (BCC) to.
  6. fromName: The name of the sender.
  7. fromAddress: The email address of the sender.

Example:

String subject = 'Hello from Apex!';
String body = 'This is a test email sent from Apex.';
String[] recipients = new String[] {'[email protected]', '[email protected]'};
String[] cc = new String[] {'[email protected]'};
String[] bcc = new String[] {'[email protected]'};
String fromName = 'Apex User';
String fromAddress = '[email protected]';

ApexMail.send(subject, body, recipients, cc, bcc, fromName, fromAddress);

Notes: