0
votes

I have an image that is stored on Amazon S3 having this URL

https://s3-eu-west-1.amazonaws.com/xalata-test2/original-jpgs/221094P20151124090355377135V20151123120425503345D20151124104248446R614230518448S10.jpg

I am then using Amazon SES to attach this image to an email using Amazon SES (Simple Email Service). I am using this repository here

https://github.com/daniel-zahariev/php-aws-ses

The documentation with respect to attachments states:

https://github.com/daniel-zahariev/php-aws-ses#attachments

Now you can add an inline file in the message

$m->addAttachmentFromFile('logo.png','path/to/logo.png','application/octet-stream', '<logo.png>' , 'inline');

This is what I tried:

$fileName = 'https://s3-eu-west-1.amazonaws.com/xalata-test2/original-jpgs/221094P20151124090355377135V20151123120425503345D20151124104248446R614230518448S10.jpg';
$m->addAttachmentFromFile('logo.jpg',$fileName,'image/jpeg', 'logo.jpg' , 'inline');

It seems that the file has to be on the server. How can I attach the external file?

1

1 Answers

0
votes

Currently the function addAttachmentFromFile requires a local readable file in order to work because it makes a few checks with: file_exists, is_file and is_readable. So you have to have the file locally.