Skip to content

Commit

Permalink
Fix e-mail sender issue with SMTP_UNIQUE_SENDER setting - refs BT#12989
Browse files Browse the repository at this point in the history
  • Loading branch information
ywarnier committed Jun 23, 2017
1 parent 0af1c76 commit 650c5f3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main/inc/lib/api.lib.php
Expand Up @@ -7859,7 +7859,13 @@ function api_mail_html(
if (isset($platform_email['SMTP_UNIQUE_SENDER']) && $platform_email['SMTP_UNIQUE_SENDER']) {
$senderName = $platform_email['SMTP_FROM_NAME'];
$senderEmail = $platform_email['SMTP_FROM_EMAIL'];
$valid = PHPMailer::validateAddress($senderEmail);
if ($valid) {
//force-set Sender to $senderEmail, otherwise SetFrom only does it if it is currently empty
$mail->Sender = $senderEmail;
}
}

$mail->SetFrom($senderEmail, $senderName);
$mail->Subject = $subject;
$mail->AltBody = strip_tags(
Expand Down

0 comments on commit 650c5f3

Please sign in to comment.