swiftmailer/swiftmailer — pull request #557 by qckanemoto (2014-11-18 07:57:04+00:00)
Title: [fixes #534] fix disappearing of embedded images

This PR fixes #534.

The cause of the issue is below:

1. On spooling the message with memory spool, message will be cloned in [here](https://github.com/swiftmailer/swiftmailer/blob/master/lib/classes/Swift/MemorySpool.php#L54).
2. Swift_Message is an inheritance of Swift_Mime_SimpleMimeEntity, so children of the message are also cloned in [here](https://github.com/swiftmailer/swiftmailer/blob/master/lib/classes/Swift/Mime/SimpleMimeEntity.php#L862).
3. The instance of Swift_Image which is embedded is also child of the message, so this will be cloned too.
4. When the embedded image is cloned, Content-ID will be re-generated in [here](https://github.com/swiftmailer/swiftmailer/blob/master/lib/classes/Swift/Mime/SimpleMimeEntity.php#L859).
5. So returned Content-ID of [$message->embed($image)](https://github.com/swiftmailer/swiftmailer/blob/master/lib/classes/Swift/Mime/SimpleMessage.php#L566) and actual Content-ID of the embedded image are different.

Not to clone children such that they are instance of Swift_Mime_Attachment is resolve this problem.