25 public function __construct()
28 $this->mConvertLocal->register(
'Legacy_Mailer.ConvertLocal');
31 public function prepare()
33 $root =& XCube_Root::getSingleton();
35 $handler =& xoops_gethandler(
'config');
36 $xoopsMailerConfig =& $handler->getConfigsByCat(XOOPS_CONF_MAILER);
39 if (
'' == $xoopsMailerConfig[
'from']) {
40 $this->From = $root->mContext->mXoopsConfig[
'adminmail'];
42 $this->From = $xoopsMailerConfig[
'from'];
45 $this->Sender = $root->mContext->mXoopsConfig[
'adminmail'];
47 $this->SetLanguage = LEGACY_MAIL_LANG;
48 $this->CharSet = LEGACY_MAIL_CHAR;
49 $this->Encoding = LEGACY_MAIL_ENCO;
51 switch ($xoopsMailerConfig[
'mailmethod']) {
54 $this->SMTPAuth =
true;
55 $this->Host = implode(
';', $xoopsMailerConfig[
'smtphost']);
56 $this->Username = $xoopsMailerConfig[
'smtpuser'];
57 $this->Password = $xoopsMailerConfig[
'smtppass'];
62 $this->SMTPAuth =
false;
63 $this->Host = implode(
';', $xoopsMailerConfig[
'smtphost']);
68 $this->Sendmail = $xoopsMailerConfig[
'sendmailpath'];
75 public function setFrom($text)
80 public function setFromname($text)
82 $this->FromName = $this->convertLocal($text, 2);
85 public function setSubject($text)
87 $this->Subject = $this->convertLocal($text,
true);
90 public function setBody($text)
92 $this->Body = $this->convertLocal($text);
95 public function setTo($add, $name)
97 $this->AddAddress($add, $this->convertLocal($name,
true));
100 public function reset()
102 $this->ClearAllRecipients();
107 public function convertLocal($text, $mime =
false)
109 $this->mConvertLocal->call(
new XCube_Ref($text), $mime);