15
我嘗試發送帶有html內容的模板 ,但在電子郵件中,我收到的只是文本SwiftmailerBundle如何發送電子郵件與HTML內容? Symfony 2
如何設置發送帶有html內容的電子郵件?
$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);
你是最棒的指定內容類型! – Matheno 2014-12-19 11:13:52