next2u next2u - 10 months ago 85
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??


Ok, finally i got the solution..

replace the line


with this

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

This worked..