Apex からのメール制限はありません。sendEmail() メソッドを Apex から呼び出す回数に制限があります。 Apex からのメールに制限はありませんが、トランザクションで sendEmail() メソッドを Apex から呼び出す回数に制限があります。
ベストプラクティスは forループ内で sendEmail() メソッドを呼び出さないことです。
メモ: 以下のコードは 1 つの例です。本番に進む前にコードを常にテストする必要があります。
//method to send mail to a list of users
public static void DispatchEmail() {
List lstMails = new List();
lst = 20;
for(Integer i : lst) {
Messaging.SingleEmailMessage message = getEmail();
//Construct the email message here by populating the values such as body, subject
//Adding emails to the list
lstMails.add(message);
}
//Sending the email list in a single call.
Messaging.sendEmail(lstMails);
}
public static Messaging.SingleEmailMessage getEmail() {
Messaging.SingleEmailMessage mailMessage = new Messaging.SingleEmailMessage();
mailMessage.setSaveAsActivity(false);
return mailMessage;
}000385111

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.