No Amazon NODEMailer connection

I am using nodejs nodemailer to connect to Amazon SES email. Everything looks simple, but I keep getting the error:

"The request signature we signed does not match the signature you provided. Verify your AWS secret access key and signature method. For more information, see the technical documentation."

I have already searched the Internet, and most people say that this is because you have a place at the end of your secret key, or sometimes a slash can be the cause of the problem. The latter is no longer a problem, as I continued to create SMTP credentials until they were gone. Now I created about 10 SMTP credentials, copied and pasted AccessKey and SecretKey each time, and I still get this error. I also tried using http://email-smtp.us-west-2.amazonaws.com and still getting the same error.

Here is my code:

var nodemailer = require("nodemailer"); var transport = nodemailer.createTransport("SES", { AWSAccessKeyID: 'AKIA************', AWSSecretKey: 'AqlwF*****************************', SeviceUrl: 'http://email-smtp.us-east-1.amazonaws.com' }); nodemailer.sendMail({ transport : transport, sender : ' some@thing.com ' , to : ' another@address.com ', subject : 'TEST', html: '<p> Hello World </p>' }, function(error, response) { if(error){ console.log(error); } else{ console.log("Message sent: " + response.message);} }); 

Does anyone know what else I can do?

+6
source share
2 answers

This happens when you use your AWS SMTP credentials. You must create an AIM user and assign the following policy to him:

 { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["ses:SendEmail", "ses:SendRawEmail"], "Resource": "*" } ] } 
+3
source

Amazon ses allows you to send emails to and from email addresses registered with your amazon aws account. You can try checking them out, maybe this is a problem.

http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html

It has a description of how to check them.

EDIT: Steps for transporting nodemailer ses for proper operation. 1. Install the ses ready base conveyor. It can be created just like you. (What did you do)

 var nodemailer = require("nodemailer"); var transport = nodemailer.createTransport("SES", { AWSAccessKeyID: 'AKIA************', AWSSecretKey: 'AqlwF*****************************', SeviceUrl: 'http://email-smtp.us-east-1.amazonaws.com' }); mail={ transport : transport, sender : ' some@thing.com ' , to : ' another@address.com ', subject : 'TEST', html: '<p> Hello World </p>' }; 
  1. Get the passkey and awsSecretKey from your amazon aws account (what you did.)

  2. Now, as soon as you finish with the above steps, you will be able to send letters to the email addresses that you registered to your amazon ses account (a confirmation link will be sent to the access email account you specified, and you need to click them to confirm). The link for checking email addresses through your account is the link I posted above.

which it looks like you haven't done yet. Therefore, register the email addresses you want to send emails (as well as from!) And use these email addresses in your own and at the code addresses.

If you want to send emails to email addresses that you have not registered, you need to request premium access. It can be found in your production access account. Link to this page -

https://docs.aws.amazon.com/ses/latest/DeveloperGuide/request-production-access.html

Hope this solves your problem. And thanks to Rob for the tip.

-1
source

Source: https://habr.com/ru/post/971365/


All Articles