Skip to content
Snippets Groups Projects
Commit f9a9fc56 authored by Lukas Reschke's avatar Lukas Reschke
Browse files

Merge pull request #1265 from j-ed/master

add additional mail_smtp.. parameters to fix possible SMTP connection problems.
parents 3ff32eba dcda792f
Branches
No related tags found
No related merge requests found
......@@ -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)
*/
......
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment