Add SMTP unique sender configuration - refs BT#9588

1.10.x
Nicolas Ducoulombier 10 years ago
parent ab65166912
commit 5d3560a8c4
  1. 1
      main/inc/conf/mail.conf.dist.php
  2. 6
      main/inc/lib/api.lib.php

@ -16,3 +16,4 @@ $platform_email['SMTP_AUTH'] = 0;
$platform_email['SMTP_USER'] = '';
$platform_email['SMTP_PASS'] = '';
$platform_email['SMTP_CHARSET'] = api_get_system_encoding();
$platform_email['SMTP_UNIQUE_SENDER']= 0; // to send all mails from the same user

@ -7897,7 +7897,11 @@ function api_mail_html(
$mail->Sender = $extra_headers['reply_to']['mail'];
unset($extra_headers['reply_to']);
}
//If the SMTP configuration only accept one sender
if ($platform_email['SMTP_UNIQUE_SENDER']) {
$senderName = $platform_email['SMTP_FROM_NAME'];
$senderEmail = $platform_email['SMTP_FROM_EMAIL'];
}
$mail->SetFrom($senderEmail, $senderName);
$mail->Subject = $subject;

Loading…
Cancel
Save