1
Antoine
XoopsMailer->sendMail usage
  • 2005/8/17 10:13

  • Antoine

  • Friend of XOOPS

  • Posts: 112

  • Since: 2004/11/14


Hi,

I'm trying to use XoopsMailer for the first time.
I am using something like:
$myMailer = new XoopsMailer();
$result $myMailer->sendMail($xoopsConfig['adminmail'], 'Site-error'$body, array());

I am using the default PHPMail() to try and send the e-mail. My php.ini settings are correct.
The error I am getting is:
Could not instantiate mail()

Please, can anyone help me out?

EDIT: I am running XOOPS 2.0.13.1

2
Antoine
Re: XoopsMailer->sendMail usage
  • 2005/8/23 8:09

  • Antoine

  • Friend of XOOPS

  • Posts: 112

  • Since: 2004/11/14


bump

Pretty, pretty please?

3
kaotik
Re: XoopsMailer->sendMail usage
  • 2005/8/23 9:54

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


Here's how to use it:

//mail to customer and admin
$xoopsMailer =& getMailer(); //Get mailer object
$xoopsMailer->useMail(); // Set it to use email (as opposed to PM)
$xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH."/modules/kshop/language/".$xoopsConfig['language']."/mail_template/");
$xoopsMailer->setTemplate('send_order.tpl');
$xoopsMailer->assign('FIRSTNAME'$firstname); //assign some vars for mail template
$xoopsMailer->assign('LASTNAME'$lastname);
$xoopsMailer->assign('COMPANY'$companyinfo);



$xoopsMailer->setToEmails( array($email$xoopsModuleConfig['mailorder']) ); //send mail to 2 address
$xoopsMailer->setFromEmail($xoopsModuleConfig['mailcontact']); // set from field
$xoopsMailer->setFromName($xoopsModuleConfig['shopname']); //set from name field

//$xoopsMailer->setBody($message); //if not using a mail template use setBody instead
$xoopsMailer->setSubject($subject);


if (
$xoopsMailer->send()) {
    
//send was successful
    
}

4
Antoine
Re: XoopsMailer->sendMail usage
  • 2005/8/23 10:32

  • Antoine

  • Friend of XOOPS

  • Posts: 112

  • Since: 2004/11/14


Thanks a bunch!
So what is the sendMail($email, $subject, $body, $headers) function for? And what is meant with the $headers parameter in it?

5
zoullou
Re: XoopsMailer->sendMail usage
  • 2005/8/23 12:38

  • zoullou

  • Quite a regular

  • Posts: 250

  • Since: 2004/3/2 0


I think that sendMail is private. This fonction is used in a loop in send() to send email to each member.
Header is an array of mail header like reply-to...

Cheers

Login

Who's Online

192 user(s) are online (117 user(s) are browsing Support Forums)


Members: 0


Guests: 192


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