summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2013-01-02 10:48:58 -0800
committerJörn Friedrich Dreyer <jfd@butonic.de>2013-01-02 10:48:58 -0800
commit824071730937889f0fdfcaae6420536e5a9d06f2 (patch)
tree282ccbcac449ceed28e14096118e68c956c2ad66
parent166da88b73df7720cd7d6a29924bd3beb45af375 (diff)
parent1727b2e84d9c6202f4777dff3c6b7433ec8783c7 (diff)
downloadnextcloud-server-824071730937889f0fdfcaae6420536e5a9d06f2.tar.gz
nextcloud-server-824071730937889f0fdfcaae6420536e5a9d06f2.zip
Merge pull request #1062 from owncloud/fix-1048-master
add smtp port configuration option
-rw-r--r--config/config.sample.php3
-rw-r--r--lib/mail.php14
2 files changed, 11 insertions, 6 deletions
diff --git a/config/config.sample.php b/config/config.sample.php
index 78dfe17ea79..2eec7847f9c 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -78,6 +78,9 @@ $CONFIG = array(
/* Host to use for sending mail, depends on mail_smtpmode if this is used */
"mail_smtphost" => "127.0.0.1",
+/* Port to use for sending mail, depends on mail_smtpmode if this is used */
+"mail_smtpport" => 25,
+
/* authentication needed to send mail, depends on mail_smtpmode if this is used
* (false = disable authentication)
*/
diff --git a/lib/mail.php b/lib/mail.php
index c78fcce88d4..4683a1b4eee 100644
--- a/lib/mail.php
+++ b/lib/mail.php
@@ -25,12 +25,18 @@ class OC_Mail {
* @param string $mailtext
* @param string $fromaddress
* @param string $fromname
- * @param bool $html
+ * @param bool|int $html
+ * @param string $altbody
+ * @param string $ccaddress
+ * @param string $ccname
+ * @param string $bcc
+ * @throws Exception
*/
public static function send($toaddress,$toname,$subject,$mailtext,$fromaddress,$fromname,$html=0,$altbody='',$ccaddress='',$ccname='', $bcc='') {
$SMTPMODE = OC_Config::getValue( 'mail_smtpmode', 'sendmail' );
$SMTPHOST = OC_Config::getValue( 'mail_smtphost', '127.0.0.1' );
+ $SMTPPORT = OC_Config::getValue( 'mail_smtpport', 25 );
$SMTPAUTH = OC_Config::getValue( 'mail_smtpauth', false );
$SMTPUSERNAME = OC_Config::getValue( 'mail_smtpname', '' );
$SMTPPASSWORD = OC_Config::getValue( 'mail_smtppassword', '' );
@@ -49,6 +55,7 @@ class OC_Mail {
$mailo->Host = $SMTPHOST;
+ $mailo->Port = $SMTPPORT;
$mailo->SMTPAuth = $SMTPAUTH;
$mailo->Username = $SMTPUSERNAME;
$mailo->Password = $SMTPPASSWORD;
@@ -89,8 +96,6 @@ class OC_Mail {
}
}
-
-
/**
* return the footer for a mail
*
@@ -103,7 +108,4 @@ class OC_Mail {
return($txt);
}
-
-
-
}