next2u next2u - 1 year ago 122
PHP Question

how to read template using swift mailer?

I have a

template file(html file)
. I have to include this template in my mail. How can i read template using
swift mailer

I tried

$emailBody = readTemplateFile("");
$emailBody_new = str_replace("#name#",$reg_fname,$emailBody);
$emailBody_new = str_replace("#email#",$url,$emailBody_new);

But in mail the
tags and
are displayed as plane text. How can i did this??

Answer Source

Ok, finally i got the solution..

replace the line


with this

$message->setBody($emailBody_new, "text/html");

This worked..

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download