1
haisam
xoopsmailer: how to use in modules/news/article.php
  • 2004/1/23 1:18

  • haisam

  • Just popping in

  • Posts: 45

  • Since: 2003/11/11


I've placed the following code in modules/news/article.php such that I would be able to mail the entire content of an article, but I get no errors and no email is sent (as far as I can tell). Yest $to, $from are defined. I took the code from modules/contact/index.php

$xoopsMailer =& getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setToEmails("$to");
$xoopsMailer->setFromEmail("$from");
$xoopsMailer->setFromName("something");
$xoopsMailer->setSubject("test");
$xoopsMailer->setBody("test");
$xoopsMailer->send();

2
haisam
Re: xoopsmailer: how to use in modules/news/article.php
  • 2004/1/23 2:15

  • haisam

  • Just popping in

  • Posts: 45

  • Since: 2003/11/11


Ok instead I now added the following in modules/news/article.php but without success:

include XOOPS_ROOT_PATH."/class/xoopsmailer.php";

$xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH.'/modules/wfchannel/language/'.$xoopsConfig['language'].'/mail_template');
$xoopsMailer->setTemplate("refer.tpl");

$xoopsMailer =& getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setToEmails("$to");
$xoopsMailer->setFromEmail("$from");
$xoopsMailer->setFromName("something");
$xoopsMailer->setSubject("test");
$xoopsMailer->setBody("test");
$xoopsMailer->assign("MESSAGE", "some message");
$xoopsMailer->assign("SITENAME", $xoopsConfig['sitename']);
$xoopsMailer->assign("SITEURL", XOOPS_URL."/");

$xoopsMailer->send();


got the procedure from:
http://dev.xoops.org/modules/phpwiki/index.php?pagename=XoopsMailer

3
Mithrandir
Re: xoopsmailer: how to use in modules/news/article.php

The templateDir and template should come after $xoopsMailer =& getMailer();

Otherwise you are calling a function on a non-object.

4
haisam
Re: xoopsmailer: how to use in modules/news/article.php
  • 2004/1/23 12:24

  • haisam

  • Just popping in

  • Posts: 45

  • Since: 2003/11/11


You're right but the correction does'nt cause a send mail to go out.

5
Mithrandir
Re: xoopsmailer: how to use in modules/news/article.php

Are other emails sent out properly?

6
haisam
Re: xoopsmailer: how to use in modules/news/article.php
  • 2004/1/23 23:41

  • haisam

  • Just popping in

  • Posts: 45

  • Since: 2003/11/11


Quote:

Mithrandir wrote:
Are other emails sent out properly?


yes

Login

Who's Online

110 user(s) are online (80 user(s) are browsing Support Forums)


Members: 0


Guests: 110


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits