Amazon SES Error for VERIFIED address "MessageRejected: Email address is not verified" - amazon-ses

I have an Amazon SES connection setup which is currently in Sandbox mode.
I have my email address, I use my real one but for this post let's call it myemail#arealdomain.com. It's verified in SES, in the email tab it says "verified" right next to it.
I have a Node app which sends the mail via Nodemailer
this.transporter = nodemailer.createTransport({
SES: new aws.SES({ region: "us-east-1" })
});
this.defaultFromAddress = 'myemail#arealdomain.com';
and then I send it with this.transporter.sendMail, with ALL email addresses being the same myemail#arealdomain.com
When I try to send an email, (both TO and FROM the same address, which is Verified on SES)
On send I get the below error
Error: MessageRejected: Email address is not verified. The following identities failed the check in region US-EAST-1: myemail#arealdomain.com
Any ideas how to fix?
update
Per the conversation below I triple confirmed both my region and email address is correct across both my code and AWS. The to and from address are the same, and is listed in AWS as "verified". I'm still having this issue and totally unsure how to proceed
update2
Sending a "Test Email" from the SES dashboard works just fine, using the same email addresses...
update3
It gets weirder! So we got out of Sandbox mode yesterday and are a normal SES account now. Same exact errors no matter what combo of to/from addresses I'm using. I'm always using a "verified" address as the FROM, and no matter the TO (even if it's also a verified address) I get the exact same error that
Error: MessageRejected: Email address is not verified. The following
identities failed the check in region US-EAST-1:
myemail#arealdomain.com

Okay so it turns out while I was running locally it was using the incorrect AWS credentials (for an other project). Still unsure how to fix but that's the actual problem nothing wrong with SES

We had a similar problem today, and after checking all the credentials and the SES dashboard, the answer turned out to be a case-sensitivity issue in the left-hand side of the address. The verified email was:
noreply#company.com
but I was setting
NoReply#company.com
in the header, and that caused the verification to fail.

Faced the same issue today. Wasted couple of hours on this.
SESv2Client library for node.js uses the default aws-cli config when the credentials config is not passed propery.
const ses = new SESv2Client({
region: 'region-code',
credentials: {
accessKeyId: 'ABC',
secretAccessKey: 'xyz'
}
});

Related

Configure AWS Cognitp UserPool to send emails with SES using CDK

I have an UserPool provisioned with AWS CDK.
I now noticed that Cognito is sending emails from Cognitop itself which is restricted in rates and amount of emails. They recommend to switch to an SES configuration.
After updating AWS-CDK to version 1.147.0 I was able to configure the UserPool's email settings.
this.userPool = new cognito.UserPool(this, "auth-pool", {
userPoolName: `...`,
...
email: cognito.UserPoolEmail.withSES({
sesRegion: "eu-west-1",
fromEmail: "...",
}),
...
})
I added before calling cdk deploy a verified identity
for the domain
and also for the email no-reply#DOMAIN
I also clicked on the verify link on the received email.
Still I get the following error when I try to deploy the stack changes:
Cognito received the following error from Amazon SES when attempting to send email: Email address is not verified. The following identities failed the check in region
EU-WEST-1: arn:aws:ses:eu-west-1:ACCOUNT:identity/no-reply#DOMAIN
My Stack runs in a different region but as Cognito can also use eu-west-1 (and other regions) I use this for the CDK settings.
Anyone an idea? I configured this manually in the AWS console and it is working :-|
Did you try sending a test email from the domain/email you verified? See end of this tutorial video:
https://www.youtube.com/watch?v=nxXIpPZzMd0

Cannot configure From email in new User Pool

I am configuring a new Cognito User Pool. I have a verified email address which I am using, but when I try to create the user pool, I get the following error with no hint as to which parameter is invalid:
Cannot configure From email address for default email configuration (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException*'*
Any ideas?
I had same issue, Since I had from email address arn, I removed the from email address it worked for me.
There are two solutions here:
using SES
remove email "FROM email address" to use defaults
As mentioned in the comment above, changing to use SES seems to solve this issue. I had exactly same problem and using SES worked.

AWS [SES]: the reason(s) behind getting ProductionAccessNotGrantedException

To use the SES within AWS to handle my site's subscriptions, I did the following:
Verified my email and domain that I want to send the email from. Also used IAM and gave the proper access to send a customized email
Using AWS Cli created a CustomVerificationEmailTemplate.
Created a configuration set and linked it to a SNS.
Used Java SDK, created a client of type AmazonSimpleEmailService and a sendCustomVerificationEmailRequest variable and used the sendCustomVerificationEmail method to send the invitation email.
However I do get the following exception:
[ProductionAccessNotGrantedException: null (Service: AmazonSimpleEmailService; Status Code: 400; Error Code: ProductionAccessNotGranted; Request ID: *****
Any idea why I do get this exception? Where should I get the production access?
SES service will be under sandbox status by default in all AWS accounts. In sandbox status, we can not do certain things like using CustomVerificationEmailTemplate.
We need to raise a service request to take it out of sandbox status. more documentation process on how to get it out sandbox status is here.

Can't recieve incoming mail with Mailgun

I'm trying to set up inbound mail with mailgun. I want to receive email at support#mydomain.com. (changed for privacy)
All Mailgun's DNS checks pass.
I have a route set up. The expression is match_recipient("support#mydomain.com") and the action is forward("me#gmail.com")
When I use the route testing tool it correctly matches my route.
But when I send email in real life to support#mydomain.com, I get a failure notice. The error message is:
Your message cannot be delivered to the following recipients:
Recipient address: support#mydomain.com
Reason: Remote SMTP server has rejected address
Diagnostic code: smtp;550 5.7.1 Relaying denied
Remote system: dns;mxb.mailgun.org (TCP|17.172.80.96|58312|52.5.239.85|25) (ak47 ESMTP ready)
What step am I missing here?
I know this is over a year old, but since I spent 4 hours trying to figure this out, I will share my solution:
My mailgun account wasn't verified. I saw someone suggest this but I figured they just meant that I had to verify the address I was forwarding to. Nope, when I logged it today I saw a banner at the top saying click here to resend your verification email. I did that, it went through a text message verification process, and all immediately started working!

Default reset password email not sent via Appcelerator backend, nor emails with a template, only email configuration changes are sent

When I execute the following code,
Cloud.Users.requestResetPassword({
email: myUsersEmailAddress
}, function (e) {
if (e.success) {
Ti.API.info('Success: Reset Request Sent ' + JSON.stringify(e));
} else {
Ti.API.error('Error:\n' + ((e.error && e.message) || JSON.stringify(e)));
}
});
I should receive an email to reset my password, as seen in the documentation:
GET users/request_reset_password.json Sends an email to a user
containing a link to recover a lost password. You can use the default
email template provided by ACS, or specify a custom email template
that you have created. When using a custom email template, the email
must contain a properly formatted URL, as explained in the template
method parameter documentation below.
When the alert pops up, I can see that there was a match and that an email should have been sent.
However, I do not receive an email, nor do I see anything in the logs of my email backend (which does receive an email when I adapt my email configuration on the appc backend, thus my email is correctly configured)
I don't have any email templates configured, but according to the documentation it should use appc's default reset password email.
Does anyone has an idea about what I am doing wrong, or does this indicate an issue with appc's documentation or backend?
UPDATE: I have another function which sends email using a self-defined email template. When I invoke this function, i receive the following event(between the {}):
[INFO] : Deactivation email sent. {"success":true,"error":false,"meta":{"status":"ok","code":200,"method_name":"emailFromTemplate"}}
However, nothing is seen on our smtp backend. The only things we do see (and which we receive in our mailbox) are the emails which are sent when you adapt your email configuration settings in Appcelerator's backend, eg.
Subject: Appcelerator Cloud Services SMTP Test
Appcelerator Logo Hi Peter,
Your SMTP settings have been updated successfully!
Onward,
The Appcelerator Platform Team
Thanks,
David
It turned out to be a configuration issue, which could only be discovered by doing some curl calls against the api. So a good advice, test your config with curl too, and don't rely on the emails which are sent after you made a configuration change!