php-ews icon indicating copy to clipboard operation
php-ews copied to clipboard

Inline Attachements

Open basementmedia2 opened this issue 7 years ago • 2 comments

Hi,

sending Mails with attachments now works perfect, but not with InlineAttachments ;-(

Supposed i have '<img src="cid:picture1.jpg">' within my body and want to create an inlineAttachment? Where can i set, that the attachment withing the createAttachment method? Is this ok?

$api->getClient()->CreateAttachment(array (
				'ParentItemId' => $mailId->toArray(),
				'Attachments' => array (
					'FileAttachment' => array (
						'Name' => 'picture1.jpg',
						'Content' => file_get_contents('picture1.jpg'),
						'isInline' => '1'
					)
				),
			));

Best regards

Daniel

basementmedia2 avatar Apr 25 '18 13:04 basementmedia2

it seems that an html code has been filtered out at text Position 'Supposed i have '' . Between the brackets 'img src=cid:picture1.jpg' is missing.

basementmedia2 avatar Apr 25 '18 19:04 basementmedia2

For that you should wrap it in `'s, like you would with code

Garethp avatar Apr 25 '18 20:04 Garethp