diff --git a/src/MDMailerHelper.php b/src/MDMailerHelper.php index 612b0d8..213e2ae 100644 --- a/src/MDMailerHelper.php +++ b/src/MDMailerHelper.php @@ -26,14 +26,14 @@ final class MDMailerHelper { $gpg->seterrormode(GNUPG_ERROR_EXCEPTION); if (empty($recipients = $gpg->keyinfo($to))) { - throw new \Exception("Cannot retrieve public key of recipient for GPG encryption"); + throw new \Exception("Cannot retrieve public key of recipient for GPG encryption for mail address: " . $to); } foreach ($recipients as $recipient) { $recipient_fingerprint = $recipient["subkeys"][0]["fingerprint"]; if (empty($recipient = $gpg->addencryptkey($recipient_fingerprint))) { - throw new \Exception("Cannot set public key of recipient for GPG encryption"); + throw new \Exception("Cannot set public key of recipient for GPG encryption for user: " . $to); } }