1
phpsharma
how to use xoopsmailer class to send email to send for a single user
  • 2004/12/2 15:43

  • phpsharma

  • Just popping in

  • Posts: 16

  • Since: 2004/9/23


Hi
how to send a mail with template to single user.

$xoopsMailer1 =& getMailer();
$xoopsMailer1->useMail();
$xoopsMailer1->setTemplate('register.tpl');
$xoopsMailer1->assign('SITENAME', $xoopsConfig['sitename']);
$xoopsMailer1->assign('ADMINMAIL', $xoopsConfig['adminmail']);
$xoopsMailer1->assign('SITEURL', XOOPS_URL."/");

Setusers will send the mails to single user

$email_user=sample@sample.com
$xoopsMailer1->setToUsers($email_user);

$xoopsMailer1->setFromEmail($xoopsConfig['adminmail']);
$xoopsMailer1->setFromName($xoopsConfig['sitename']);
$xoopsMailer1->setSubject(sprintf(_US_USERKEYFOR1,$myts->oopsStripSlashesGPC($uname)));
$xoopsMailer1->send();

Please help me.

2
Mithrandir
Re: how to use xoopsmailer class to send email to send for a single user

Replace
$xoopsMailer1->setToUsers($email_user);

with
$xoopsMailer1->setToEmails($email_user);


setToUsers sends the email to a XoopsUser - setToEmails is used to set an email address or an array of email addresses as recipients.

3
phpsharma
Re: how to use xoopsmailer class to send email to send for a single user
  • 2004/12/2 18:21

  • phpsharma

  • Just popping in

  • Posts: 16

  • Since: 2004/9/23


Thank you for your reply..

Just realized to use...
$xoopsMailer1->setToEmails($email_user);

Login

Who's Online

273 user(s) are online (181 user(s) are browsing Support Forums)


Members: 0


Guests: 273


more...

Donat-O-Meter

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

Latest GitHub Commits