summaryrefslogtreecommitdiffstats
path: root/lib/mail.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mail.php')
-rw-r--r--lib/mail.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/mail.php b/lib/mail.php
index 7eb2c4770c5..8d30fff9f28 100644
--- a/lib/mail.php
+++ b/lib/mail.php
@@ -12,12 +12,12 @@
* A class to handle mail sending.
*/
-require_once('class.phpmailer.php');
+require_once 'class.phpmailer.php';
class OC_Mail {
/**
- * send an email
+ * send an email
*
* @param string $toaddress
* @param string $toname
@@ -31,17 +31,17 @@ class OC_Mail {
$SMTPMODE = OC_Config::getValue( 'mail_smtpmode', 'sendmail' );
$SMTPHOST = OC_Config::getValue( 'mail_smtphost', '127.0.0.1' );
- $SMTPAUTH = OC_Config::getValue( 'mail_smtpauth', false );
- $SMTPUSERNAME = OC_Config::getValue( 'mail_smtpname', '' );
- $SMTPPASSWORD = OC_Config::getValue( 'mail_smtppassword', '' );
+ $SMTPAUTH = OC_Config::getValue( 'mail_smtpauth', false );
+ $SMTPUSERNAME = OC_Config::getValue( 'mail_smtpname', '' );
+ $SMTPPASSWORD = OC_Config::getValue( 'mail_smtppassword', '' );
$mailo = new PHPMailer(true);
if($SMTPMODE=='sendmail') {
$mailo->IsSendmail();
- }elseif($SMTPMODE=='smtp'){
+ }elseif($SMTPMODE=='smtp') {
$mailo->IsSMTP();
- }elseif($SMTPMODE=='qmail'){
+ }elseif($SMTPMODE=='qmail') {
$mailo->IsQmail();
}else{
$mailo->IsMail();
@@ -55,6 +55,7 @@ class OC_Mail {
$mailo->From =$fromaddress;
$mailo->FromName = $fromname;;
+ $mailo->Sender =$fromaddress;
$a=explode(' ',$toaddress);
try {
foreach($a as $ad) {
@@ -83,7 +84,8 @@ class OC_Mail {
unset($mailo);
OC_Log::write('mail', 'Mail from '.$fromname.' ('.$fromaddress.')'.' to: '.$toname.'('.$toaddress.')'.' subject: '.$subject, OC_Log::DEBUG);
} catch (Exception $exception) {
- OC_Log::write('mail', $exception->getMessage(), OC_Log::DEBUG);
+ OC_Log::write('mail', $exception->getMessage(), OC_Log::ERROR);
+ throw($exception);
}
}