loic-sharma / Messages

A Laravel Bundle for the Swiftmailer library
GNU Lesser General Public License v3.0
39 stars 7 forks source link

send multipart (plain+html) #12

Closed Kampfbereit closed 11 years ago

Kampfbereit commented 11 years ago

Is there a way to send a multipart mail. The examples show how to either send plain or html, but not both in the same mail.

loic-sharma commented 11 years ago

This library is intended to be simplify using the Swiftmailer library, and as so doesn't handle more complicated things like this. For this, you'd have to directly access the Swift Mailer instance and mess with the headers.

To access the swiftmailer interface you can do:

$message = Message::instance();

$message->swift()->getHeaders();

// Change the headers according to what you need

$message->send();

Here's the documentation you'll need from the Swiftmailer library: http://swiftmailer.org/docs/headers.html

Kampfbereit commented 11 years ago

Ok thank you, will check it out. Do you think it's possible with the pending pull-request to use the swift "setbody" and "addpart" as described in the 1st code example here? http://swiftmailer.org/docs/messages.html

loic-sharma commented 11 years ago

Yep, it should let you do that directly. I just pulled that request a minute ago. :)