Merge pull request #1265 from j-ed/master
add additional mail_smtp.. parameters to fix possible SMTP connection problems.
This commit is contained in:
commit
f9a9fc5670
2 changed files with 18 additions and 2 deletions
|
@ -66,6 +66,9 @@ $CONFIG = array(
|
|||
/* URL of the appstore to use, server should understand OCS */
|
||||
"appstoreurl" => "http://api.apps.owncloud.com/v1",
|
||||
|
||||
/* Enable SMTP class debugging */
|
||||
"mail_smtpdebug" => false,
|
||||
|
||||
/* Mode to use for sending mail, can be sendmail, smtp, qmail or php, see PHPMailer docs */
|
||||
"mail_smtpmode" => "sendmail",
|
||||
|
||||
|
@ -75,6 +78,13 @@ $CONFIG = array(
|
|||
/* Port to use for sending mail, depends on mail_smtpmode if this is used */
|
||||
"mail_smtpport" => 25,
|
||||
|
||||
/* SMTP server timeout in seconds for sending mail, depends on mail_smtpmode if this is used */
|
||||
"mail_smtptimeout" => 10,
|
||||
|
||||
/* SMTP connection prefix or sending mail, depends on mail_smtpmode if this is used.
|
||||
Can be '', ssl or tls */
|
||||
"mail_smtpsecure" => "",
|
||||
|
||||
/* authentication needed to send mail, depends on mail_smtpmode if this is used
|
||||
* (false = disable authentication)
|
||||
*/
|
||||
|
|
10
lib/mail.php
10
lib/mail.php
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue