]> source.dussan.org Git - nextcloud-server.git/commitdiff
Update lib/mail.php
authorj-ed <juergen@eisfair.org>
Tue, 22 Jan 2013 13:13:24 +0000 (14:13 +0100)
committerj-ed <juergen@eisfair.org>
Tue, 22 Jan 2013 13:13:24 +0000 (14:13 +0100)
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.

lib/mail.php

index 4683a1b4eee21480a57b4c98e158633cf0ad70bc..ffc4d01b79f5dbde035be04f369f62d58d5f4f96 100644 (file)
@@ -40,6 +40,9 @@ class OC_Mail {
                $SMTPAUTH = OC_Config::getValue( 'mail_smtpauth', false );
                $SMTPUSERNAME = OC_Config::getValue( 'mail_smtpname', '' );
                $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);
@@ -57,12 +60,15 @@ class OC_Mail {
                $mailo->Host = $SMTPHOST;
                $mailo->Port = $SMTPPORT;
                $mailo->SMTPAuth = $SMTPAUTH;
+               $mailo->SMTPDebug = $SMTPDEBUG;
+               $mailo->SMTPSecure = $SMTPSECURE;
                $mailo->Username = $SMTPUSERNAME;
                $mailo->Password = $SMTPPASSWORD;
+               $mailo->Timeout  = $SMTPTIMEOUT;
 
-               $mailo->From =$fromaddress;
+               $mailo->From = $fromaddress;
                $mailo->FromName = $fromname;;
-               $mailo->Sender =$fromaddress;
+               $mailo->Sender = $fromaddress;
                $a=explode(' ', $toaddress);
                try {
                        foreach($a as $ad) {