Posted By

metoikos on 10/07/10


Tagged

php mail symfony swift


Versions (?)

symfony html mail via swift mailer


 / Published in: PHP
 

  1. $mail_body = '<p>custom html mail content</p>';
  2. $message = Swift_Message::newInstance('Message title')
  3. ->setFrom(array('sender'))
  4. ->setTo(array('receiver'))
  5. ->setBody($mail_body, 'text/html', 'utf-8');
  6.  
  7. try {
  8. $this->getMailer()->send($message);
  9. }
  10. catch(Exception $e) {
  11. // yay
  12. }

Report this snippet  

You need to login to post a comment.