Bladeren bron

Add SMTP unique sender configuration - refs BT#9588

Nicolas Ducoulombier 10 jaren geleden
bovenliggende
commit
5d3560a8c4
2 gewijzigde bestanden met toevoegingen van 6 en 1 verwijderingen
  1. 1 0
      main/inc/conf/mail.conf.dist.php
  2. 5 1
      main/inc/lib/api.lib.php

+ 1 - 0
main/inc/conf/mail.conf.dist.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

+ 5 - 1
main/inc/lib/api.lib.php

@@ -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;