daniel-zahariev / php-aws-ses

PHP classes that interfaces Amazon Simple Email Service
307 stars 100 forks source link

Cannot send raw email #47

Closed mtetno closed 6 years ago

mtetno commented 6 years ago

I have tried using this library for aws ses but i m not able to send raw email via below code , please point me the issue incase i m wrong anywhere , i have tried all api mentioned and tried to send atachment also but the email appears to be unformated

<?php

require_once 'vendor/autoload.php';
error_reporting(E_ALL); ini_set('display_errors', '1');
$m = new SimpleEmailServiceMessage();
$m->addTo($_REQUEST['email']);
$m->setFrom('cc@cc-in-cc.com');
$m->setSubject('Roti receipt');
$m->setMessageFromURL('http://xxxxxxx/phpMailer/email_template.txt');
$m->addAttachmentFromData('email_template.txt', 'Simple content', 'text/plain');

$region_endpoint = SimpleEmailService::AWS_US_EAST_1;
$ses = new SimpleEmailService('xxxxx', 'xxxxxxxx+xxxxxx', $region_endpoint);

// Or overwrite the main setting on a single call
$use_raw_request = true;
$trigger_error = false;
$ses->sendEmail($m, $use_raw_request, $trigger_error);
?>
daniel-zahariev commented 6 years ago

Have you validated the sender email? What error do you get?