我使用Amazon SES发送电子邮件,我的最终发送代码是
try {
$result = $sesClient->sendEmail($email);
$messageId = $result->get('MessageId');
$result['success'] = $messageId;
} catch (Aws'Ses'Exception'SesException $e) {
$result['error'] = $e;
}
在我的查询循环结束时,我想收集所有错误并通过电子邮件发送它们,但问题是只有一个错误有大约7000个字符,这是因为如果我捕获异常或Aws'Ses'Exception'SesException,我也从GuzzleHttp'Exception'RequestException: 'GuzzleHttp'Exception'ClientException'和许多其他信息,我并不真正需要。是否有任何方法可以限制消息与主要错误消息,其中,在我的情况下,是使用没有@domain.com附加的电子邮件。
} catch (Aws'Ses'Exception'SesException $e) {
$result['error'] = $e->getMessage();
}