Create a message in Swiftmailer and use the function setBody()to install the text / plain version of your email and use the function addPart()to install the text / html version of your email (with the second parameter text/html):
$message = Swift_Message::newInstance()
->setSubject('Your subject')
->setFrom(array('john@doe.com' => 'John Doe'))
->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name'))
->setBody('Here is the message itself')
->addPart('<p>Here is the message itself</p>', 'text/html')
;
Checkout Source: http://swiftmailer.org/docs/messages.html
source
share