-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signature V4 not working? #72
Comments
Hi @jane-t, |
The sender is verified. If I call the ses set up process with It works fine, it's only when I call it with the V4 I have found the error I am getting PHP Warning: SimpleEmailService::sendEmail(): Sender - InvalidClientTokenId: The security token included in the request is invalid. I am not changing the access or secret between the two options. |
Hm, that's weird. |
Is there anything I can put in to help debug why the error is occurring?
Could you point me in the right direction to add some echo statements to
see what is being sent?
…On Tue, 21 Jul 2020 at 13:45, Daniel Zahariev ***@***.***> wrote:
Hm, that's weird.
Can't find anything that can lead to this error.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#72 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHAZWGZAOQPHEFJXR2RBZTR4WEW5ANCNFSM4PDM3Q4A>
.
|
I'll dig into this tomorrow. |
I tried setting up a new user with just the AmazonSESFullAccess
<https://console.aws.amazon.com/iam/home?region=us-east-1#/policies/arn%3Aaws%3Aiam%3A%3Aaws%3Apolicy%2FAmazonSESFullAccess>
permission, but got the same error message for V4.
…On Thu, 23 Jul 2020 at 08:32, Daniel Zahariev ***@***.***> wrote:
I'll dig into this tomorrow.
In the mean time - have you tried using different credentials?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#72 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHAZWFFFC3S653SJ5EJATTR47RRRANCNFSM4PDM3Q4A>
.
|
Did you have any liuck with this problem please? |
Still can't recreate the issue. |
Sorry to trouble you. I have downloaded the latest version using composer.
The following code appears to work eg no errors, but the email never arrives.
`$signature_version = SimpleEmailService::REQUEST_SIGNATURE_V4;
$region_endpoint = SimpleEmailService::AWS_US_EAST_1;
$trigger_error = true;
$ses = new SimpleEmailService('AccessKey', 'SecretKey', $region_endpoint, $trigger_error, $signature_version);
$messagetmpl = file_get_contents('email.txt');
$subject = $str = strtok($messagetmpl, "\n");
$userlist = file('email_list.txt');
foreach ($userlist as $line) {
// Loop Emails
$user = explode(',',$line);
$message = str_replace('{user}',$user[1],$messagetmpl);
$message = str_replace('{password}',$user[2],$message);
$message = str_replace('{signup}',$user[3],$message);
$message = str_replace('{last}',$user[4],$message);
$m = new SimpleEmailServiceMessage();
$m->addTo($user[0]);
$m->setFrom('Admin at xxxxxxx@xxxx.org.uk');
$m->setSubject($subject);
$m->setMessageFromString($message);
echo $user[0].' ',$user[1].'
';
$ses->sendEmail($m);
usleep(200000);
// End Loop Emails
}
echo 'All Done';`
If I change the ses line to just
$ses = new SimpleEmailService($key, $secret);
The email arrives, is there something I need to do in the Amazon Management Console which I have not done?
The text was updated successfully, but these errors were encountered: