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:

le="color: #000000"><?php X-Mailer: PHPMailer [version 1.73] Content-Type: text/html; charset=windows-1257 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="windows-1257"


contact_plus code section:
le="color: #000000"><?php $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


le="color: #000000"><?php [color=CC6600]$xoopsMailer->multimailer->isHTML(true);[/color]

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:
le="color: #000000"><?php $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 />"; }

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...
http://www.AnimalPedigree.com

Who's Online

150 user(s) are online (122 user(s) are browsing Support Forums)


Members: 0


Guests: 150


more...

Donat-O-Meter

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

Latest GitHub Commits