1
kaotik
Correct syntax for XoopsMultiMailer
  • 2005/6/24 16:51

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


Is this the correct way to use XoopsMultiMailer:

include_once XOOPS_ROOT_PATH.'/class/mail/xoopsmultimailer.php';
    
    
$kssendmail = new XoopsMultiMailer;
    
$kssendmail->AddAddress($to);
    
$kssendmail->Body($message);
    
$kssendmail->Subject($subject);
    
$kssendmail->From($from);
    
$kssendmail->Send();


Will this use the mailer selected in xoops?

Thanks

2
Mithrandir
Re: Correct syntax for XoopsMultiMailer

You should use it like this:

$xoopsMailer =& getMailer(); //Get mailer object
$xoopsMailer->useMail(); // Set it to use email (as opposed to PM)

$xoopsMailer->setToEmails($to);
$xoopsMailer->setFromEmail($from);
$xoopsMailer->setFromName("Sender's name");

$xoopsMailer->setBody($message);
$xoopsMailer->setSubject($subject);

if (
$xoopsMailer->send()) {
    
//send was successful
}
else {
    
//send not successful, use
    //$xoopsMailer->getErrors() to get a string of messages
}
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software

3
kaotik
Re: Correct syntax for XoopsMultiMailer
  • 2005/6/25 14:42

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


Thanks Mithrandir!
Now I understand why it wasn't working for me.

Login

Who's Online

435 user(s) are online (53 user(s) are browsing Support Forums)


Members: 0


Guests: 435


more...

Donat-O-Meter

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

Latest GitHub Commits