Changing the Disposition

Attachments just appear as files that can be saved to the Desktop if desired. You can make attachment appear inline where possible by using the setDisposition() method of an attachment.

To make an attachment appear inline:

Call its setDisposition() method.

The attachment will be displayed within the email viewing window if the mail client knows how to display it.

Note: If you try to create an inline attachment for a non-displayable file type such as a ZIP file, the mail client should just present the attachment as normal.
//Create the attachment and call its setDisposition() method
$attachment = Swift_Attachment::fromPath('/path/to/image.jpg')
  ->setDisposition('inline');


//Because there's a fluid interface, you can do this in one statement
$message->attach(
  Swift_Attachment::fromPath('/path/to/image.jpg')->setDisposition('inline')
);

NOTE: Documentation for version 3 is in the wiki.