errrors
is a list of SendEmailError
. You can Iterate and collect errors:
for (Messaging.SendEmailResult mr : mrs)
{
if (mr.isSuccess()) {
//Do something for success
} else {
// Operation failed, so get all errors
for(Messaging.SendEmailError err : mr.getErrors()) {
System.debug('The following error has occurred.');
System.debug(err.getStatusCode() + ': ' + err.getMessage());
System.debug('Account fields'fields that affected this error: ' + err.getFields());
}
}
}
See methods for SendEmailError here.