1
banesto
how can one send html mail using xoopsmail?
  • 2006/12/18 13:29

  • banesto

  • Just popping in

  • Posts: 61

  • Since: 2005/1/24


im using XOOPS 2.0.16 and module contact_plus. I need it to send a html mail, not just text/plain. So I added line addHeaders with content-type i need, but this leads to the same text/plain results.. besides, when i check mail properties it is said, that there is double content type assigning:

X-MailerPHPMailer [version 1.73]
Content-Typetext/htmlcharset=windows-1257
MIME
-Version1.0
Content
-Transfer-Encoding8bit
Content
-Typetext/plaincharset="windows-1257"


contact_plus code section:
$xoopsMailer =& getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setToEmails($xoopsConfig['adminmail']);
$xoopsMailer->setFromEmail($usersEmail);
$xoopsMailer->setFromName($xoopsConfig['sitename']);
$xoopsMailer->setSubject($subject);
$xoopsMailer->setBody($adminMessage);
$xoopsMailer->addHeaders("Content-Type: text/html; charset=windows-1257");
$xoopsMailer->send();


Could someone please clear this for me, i hate text/plain emails...
where's my red bull!

2
banesto
Re: how can one send html mail using xoopsmail?
  • 2006/12/18 13:31

  • banesto

  • Just popping in

  • Posts: 61

  • Since: 2005/1/24


I also tried to hack xoopsmailer.php and set headers there, but that didn't do a change..
where's my red bull!

3
kaotik
Re: how can one send html mail using xoopsmail?
  • 2006/12/18 15:04

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


[color=CC6600]$xoopsMailer->multimailer->isHTML(true);[/color]
www.kaotik.biz

4
kaotik
Re: how can one send html mail using xoopsmail?
  • 2006/12/18 15:07

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


If you prefer you can use an html smarty template for your mail, here's a sample from one of my modules:
$mailer getMailer();
$mailer->useMail();
$xoopsTpl->assign('sitename'$xoopsConfig['sitename']);
$xoopsTpl->assign('lastname'$lastname);
$content $xoopsTpl->fetch("db:ks_send_mail.html");
$mailer->setBody($content);
$mailer->setToEmails( array($email$xoopsModuleConfig['mailorder']) );
$mailer->setFromEmail($xoopsModuleConfig['mailcontact']);
$mailer->setFromName($xoopsModuleConfig['shopname']);
$mailer->setSubject($subject);
$mailer->multimailer->isHTML(true);
        if (
$mailer->send()) {
            
//send was successful
        
} else {
            
$this->ok=FALSE;
            
$this->msg.="error in buildMail():".$mailer->getErrors()."<br />";
        }
www.kaotik.biz

5
banesto
Re: how can one send html mail using xoopsmail?
  • 2006/12/18 15:20

  • banesto

  • Just popping in

  • Posts: 61

  • Since: 2005/1/24


Great Thanks to YOU!
where's my red bull!

6
highlander
Re: how can one send html mail using xoopsmail?
  • 2007/4/23 14:07

  • highlander

  • Not too shy to talk

  • Posts: 151

  • Since: 2004/12/5


great post ! helped me a lot today, thanx !

highlander
So, I'm in the park wondering why frisbees get larger as they get closer when suddenly, it hits me...
www.AnimalPedigree.com

Login

Who's Online

168 user(s) are online (105 user(s) are browsing Support Forums)


Members: 0


Guests: 168


more...

Donat-O-Meter

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

Latest GitHub Commits