I'm sending multiple emails using Messaging.sendEmail
. After that I'm checking for the results by looping over the List<Messaging.SendEmailResult>
just like the example below. Now my question is: what does the errors attribute contain? I tried to trigger send email error but it wasn't successful. I need to know if I can use the errors attribute to get the email address of the ones that failed or somehow find out which email from the list of emails failed. Thank you!
for (Messaging.SendEmailResult mr : mrs)
{
if (!mr.isSuccess()) {
system.debug(mr.errors);
}
}
I've also checked the following apex class documentation SendEmailError Class
but didn't find anything that could help.