29 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
33 if (!file_exists(
$file = XOOPS_ROOT_PATH . '/class/mail/phpmailer/class.phpmailer.php')) {
34 trigger_error(
'Required File ' . str_replace(XOOPS_ROOT_PATH,
'',
$file) .
' was not found in file ' . __FILE__ .
' at line ' . __LINE__, E_USER_WARNING);
37 include_once XOOPS_ROOT_PATH .
'/class/mail/phpmailer/class.phpmailer.php';
147 $this->From = $xoopsMailerConfig[
'from'];
148 if ($this->From ==
'') {
149 $this->From =
$GLOBALS[
'xoopsConfig'][
'adminmail'];
152 if ($xoopsMailerConfig[
'mailmethod'] ==
'smtpauth') {
153 $this->Mailer =
'smtp';
154 $this->SMTPAuth =
true;
156 $this->Host = implode(
';', $xoopsMailerConfig[
'smtphost']);
157 $this->Username = $xoopsMailerConfig[
'smtpuser'];
158 $this->Password = $xoopsMailerConfig[
'smtppass'];
160 $this->Mailer = $xoopsMailerConfig[
'mailmethod'];
161 $this->SMTPAuth =
false;
162 $this->Sendmail = $xoopsMailerConfig[
'sendmailpath'];
163 $this->Host = implode(
';', $xoopsMailerConfig[
'smtphost']);
165 $this->CharSet = strtolower(
_CHARSET);
166 $xoopsLanguage = preg_replace(
'/[^a-zA-Z0-9_-]/',
'',
$GLOBALS[
'xoopsConfig'][
'language']);
167 if (file_exists(XOOPS_ROOT_PATH .
'/language/' . $xoopsLanguage .
'/phpmailer.php')) {
168 include XOOPS_ROOT_PATH .
'/language/' . $xoopsLanguage .
'/phpmailer.php';
171 $this->
SetLanguage(
'en', XOOPS_ROOT_PATH .
'/class/mail/phpmailer/language/');
173 $this->PluginDir = XOOPS_ROOT_PATH .
'/class/mail/phpmailer/';
184 if (empty($addr[1])) {
185 $formatted = $addr[0];
187 $formatted = sprintf(
'%s <%s>',
'=?' . $this->CharSet .
'?B?' . base64_encode($addr[1]) .
'?=', $addr[0]);