XOOPS  2.6.0
xoopsmultimailer.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 */
11 
36 class XoopsMultiMailer extends PHPMailer
37 {
43  public $From = '';
44 
50  public $FromName = '';
51 
52  // can be 'smtp', 'sendmail', or 'mail'
66  public $Mailer = 'mail';
67 
76  public $Sendmail = '/usr/sbin/sendmail';
77 
85  public $Host = '';
86 
92  public $SMTPAuth = false;
93 
101  public $Username = '';
102 
110  public $Password = '';
111 
115  public function __construct()
116  {
118  $this->From = $xoops->getConfig('from');
119  if ($this->From == '') {
120  $this->From = $xoops->getConfig('adminmail');
121  }
122  $this->Sender = $this->From;
123  if ('smtpauth' == $xoops->getConfig('mailmethod')) {
124  $this->Mailer = 'smtp';
125  $this->SMTPAuth = true;
126  $this->Username = $xoops->getConfig('smtpuser');
127  $this->Password = $xoops->getConfig('smtppass');
128  } else {
129  $this->Mailer = $xoops->getConfig('mailmethod');
130  $this->SMTPAuth = false;
131  $this->Sendmail = $xoops->getConfig('sendmailpath');
132  }
133  // TODO: change value type of xoopsConfig 'smtphost' from array to text
134  $smtphost = $xoops->getConfig('smtphost');
135  $this->Host = is_array($smtphost) ? implode(';', $smtphost) : $smtphost;
136  //$this->PluginDir = \XoopsBaseConfig::get('root-path') . '/class/mail/phpmailer/';
137  }
138 }
static getInstance()
Definition: Xoops.php:160
$xoops
Definition: admin.php:25