i try to send template with html content but in email i received only text
how can i set for send email with html content?
$messaggio = \Swift_Message::newInstance()
->setSubject('Hello Email')
->setFrom('[email protected]')
->setTo('[email protected]')
->setBody($this->renderView('AcmeUserBundle:Default:email.text.twig'))
;
$this->get('mailer')->send($messaggio);
Specify content-type using ->setContentType("text/html")
You have to specify 'text/html' type:
->setBody($this->renderView('...:....html.twig'), 'text/html')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With