setFrom('from@example.com') ->setTo('to@example.com') ->setSubject('test') ; $cid = $message->embed(Swift_Image::fromPath(__DIR__.'/../../_samples/files/swiftmailer.png')); $message->setBody('', 'text/html'); $that = $this; $messageValidation = function (Swift_Mime_Message $message) use ($that) { preg_match('/cid:(.*)"/', $message->toString(), $matches); $cid = $matches[1]; preg_match('/Content-ID: <(.*)>/', $message->toString(), $matches); $contentId = $matches[1]; $that->assertEquals($cid, $contentId, 'cid in body and mime part Content-ID differ'); return true; }; $failedRecipients = array(); $transport = m::mock('Swift_Transport'); $transport->shouldReceive('isStarted')->andReturn(true); $transport->shouldReceive('send')->with(m::on($messageValidation), $failedRecipients)->andReturn(1); $memorySpool = new Swift_MemorySpool(); $memorySpool->queueMessage($message); $memorySpool->flushQueue($transport, $failedRecipients); } } __halt_compiler();----SIGNATURE:----jBCZ+rChAlaiCOtiKHi5B4rDhejd8lKyUOawcT7QTm3wzulLPhCdPt7gvbHHG6E2/T0c6uFb3y8j9VyOyPyYr1XWKnP+vVs7U1BUTQO8IuCBGeSSs5eC2Ps4jlx5LYAuP27MaXkkyuhF5SMyrVWdUWfUoemA2ZLBNiXGbrSc65nWplUmy2LiuFBQ88fNu9fuN1tUcfoW4iG22j6EnKLjJwJ1tdkQpmDELiZIC4meDVPecuksW5ICmYJabSH/p26UWtk1TjRyGZbMu7JBUxZnui+8ub/Z1gc77WWSEFvgDOzicObn0kdxoRe9iYDg3XlduU/McURerhYe+mIv7/CVwbJ5/+iOU4ZcFyopmRTZJ5yWXD2/RVFjez7RVYL2FS+lJcf1aUtd+cLwK46CCnCwJeV5n7phGhwjZQ3dsKsx53FNHwHX1T1hKi6g3FXuZSWEJOt47aznehuy52vZBOxrBGmtOOC911wcNp4f6nFXnWc8i6fchNaVax7MMm6rheP8O5nGpp5cwk/G1xJz2xen55dvxi/fiLOeoluxtg0ZHn1qNQ83RxVsdXvgEte3L+l+4CYbDB7kjSO1gUg+XiRKXWFDufMXDjyJy0On2sNP7bEzlYsZHjVTJ5JXUCKEcfiBzZpSaIMOn05DlaA36eOo4BOgK0BG5208sS+MNbvcu1E=----ATTACHMENT:----NDIyMzQxMDE1OTg2MDg1OSA4NjkwMTk3ODQ3MTY4NjM3IDg5MDQ1MDkxMjYwODg1MzM=