dev dev
dev dev

Reputation: 11

HTML format for joomla sendmail

I want to change the joomla plain text email format to HTML format, so when user get email from my joomla site will receive a nice looking html formated email. Anybody can assist me how to do this? Any core hack would be OK. Thanks

Upvotes: 1

Views: 3504

Answers (2)

Viszman
Viszman

Reputation: 1398

here is what u need to do, there is flat that tells joomla mailer that content is in html

jimport('joomla.mail.mail');
$user = JFactory::getUser();
$user_email = $user->email;

$mailer = JMail::getInstance();
$mailer->setSender('no-replay');
$mailer->addRecipient($user_email);
$mailer->isHTML(TRUE); <--- here is flag
$mailer->setSubject('subject');
$html= array();
$html[] = '<div style="background: red"> hello world</div>';
$mailer->setBody(implode("\n", $html));
$mailer->Send();

Upvotes: 4

Lodder
Lodder

Reputation: 19733

If you are referring to the Mass Mail system in the Joomla backend, then there is an option saying "send in HTML mode". Else I would recommend using a different component.

Upvotes: 2

Related Questions