Update lib/mail.php
Added three additional mail_smtp.. parameters. - mail_smtpdebug - enable debug messages to analyse SMTP problems. - mail_smtptimeout - set SMTP timeout which is set to 10s by default and this is sometimes to short especially if a malware/ spam scanner is used. - mail_smtpsecure - force secure SMTP connections.
This commit is contained in:
parent
dd40b691ee
commit
df6ba6955d
10
lib/mail.php
10
lib/mail.php
|
@ -40,6 +40,9 @@ class OC_Mail {
|
||||||
$SMTPAUTH = OC_Config::getValue( 'mail_smtpauth', false );
|
$SMTPAUTH = OC_Config::getValue( 'mail_smtpauth', false );
|
||||||
$SMTPUSERNAME = OC_Config::getValue( 'mail_smtpname', '' );
|
$SMTPUSERNAME = OC_Config::getValue( 'mail_smtpname', '' );
|
||||||
$SMTPPASSWORD = OC_Config::getValue( 'mail_smtppassword', '' );
|
$SMTPPASSWORD = OC_Config::getValue( 'mail_smtppassword', '' );
|
||||||
|
$SMTPDEBUG = OC_Config::getValue( 'mail_smtpdebug', false );
|
||||||
|
$SMTPTIMEOUT = OC_Config::getValue( 'mail_smtptimeout', 10 );
|
||||||
|
$SMTPSECURE = OC_Config::getValue( 'mail_smtpsecure', '' );
|
||||||
|
|
||||||
|
|
||||||
$mailo = new PHPMailer(true);
|
$mailo = new PHPMailer(true);
|
||||||
|
@ -57,12 +60,15 @@ class OC_Mail {
|
||||||
$mailo->Host = $SMTPHOST;
|
$mailo->Host = $SMTPHOST;
|
||||||
$mailo->Port = $SMTPPORT;
|
$mailo->Port = $SMTPPORT;
|
||||||
$mailo->SMTPAuth = $SMTPAUTH;
|
$mailo->SMTPAuth = $SMTPAUTH;
|
||||||
|
$mailo->SMTPDebug = $SMTPDEBUG;
|
||||||
|
$mailo->SMTPSecure = $SMTPSECURE;
|
||||||
$mailo->Username = $SMTPUSERNAME;
|
$mailo->Username = $SMTPUSERNAME;
|
||||||
$mailo->Password = $SMTPPASSWORD;
|
$mailo->Password = $SMTPPASSWORD;
|
||||||
|
$mailo->Timeout = $SMTPTIMEOUT;
|
||||||
|
|
||||||
$mailo->From =$fromaddress;
|
$mailo->From = $fromaddress;
|
||||||
$mailo->FromName = $fromname;;
|
$mailo->FromName = $fromname;;
|
||||||
$mailo->Sender =$fromaddress;
|
$mailo->Sender = $fromaddress;
|
||||||
$a=explode(' ', $toaddress);
|
$a=explode(' ', $toaddress);
|
||||||
try {
|
try {
|
||||||
foreach($a as $ad) {
|
foreach($a as $ad) {
|
||||||
|
|
Loading…
Reference in New Issue