kodus / mail

Simple, modern library of services for sending UTF-8 e-mail
38 stars 5 forks source link

Add support for inline images #4

Closed mindplay-dk closed 8 years ago

mindplay-dk commented 8 years ago

Add support for inline image attachments, e.g.:

/**
 * @return string inline content URI (e.g. "cid:xxxxx@kodus.dk")
 */
public function inline(Attachment $attachment)

Calling this should result in a MIME part along the lines of:

Content-Type: image/jpeg; name=logo.jpg
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename=logo.jpg
Content-ID: <0e91daa3-18da-4baa-92f4-6801115a6d50@kodus.mail>

aaaaaaaaaaaaaaaaaa...

And the function would return e.g. 0e91daa3-18da-4baa-92f4-6801115a6d50@kodus.mail - the client should add inline images prior to populating the HTML body, so that Content ID URIs have been generated and inserted into the HTML body prior to populating it.

Documentation should include an example demonstrating this approach.

mindplay-dk commented 8 years ago

Feature branch started here:

https://github.com/kodus/mail/tree/inline-attachments