I'm starting with the amazon servers and started studying about SES. I am using asp.net C # and made my code based tutorials. I already checked the domain and also checked the emails in which I will run the test.
So that when I run my code it generates the following error message: Transaction failed. The server response was: Message rejected: Email address is not verified.
I do not know what it is because I followed all possible steps, single detail is not yet ordered the release of access to production.
But I think it can not be, I'm still testing the service.
My Code
public void enviarSES02() { try { const String FROM = "verified email address"; const String TO = "verified email address"; const String SUBJECT = "Amazon SES test (SMTP interface accessed using C#)"; const String BODY = "This email was sent through the Amazon SES SMTP interface by using C#."; const String SMTP_USERNAME = "my username"; // Replace with your SMTP username. const String SMTP_PASSWORD = "my password"; // Replace with your SMTP password. const String HOST = "email-smtp.us-west-2.amazonaws.com"; const int PORT = 25;//already tried with all recommended ports SmtpClient client = new SmtpClient(HOST, PORT); client.Credentials = new System.Net.NetworkCredential(SMTP_USERNAME, SMTP_PASSWORD); client.EnableSsl = true; try { Console.WriteLine("Attempting to send an email through the Amazon SES SMTP interface..."); client.Send(FROM, TO, SUBJECT, BODY); Response.Write("ENVIADO"); } catch (Exception ex) { Response.Write("<br>O e-mail não foi enviado.<br>"); Response.Write("Olhao erro: " + ex.Message); } } catch (Exception ex) { Response.Write("Error message: " + ex.Message); } }
Open the Amazon SES console at https://console.aws.amazon.com/ses/ . In the left navigation pane, under Configuration, choose Verified identities. In the list of identities, choose the identity you want to configure where the Identity type is Email address and Status is Verified.
Your code indicates that you are trying to send via us-west-2
. Have you requested production access in that region, and is your From
address verified? Production access for Amazon SES is region-independent and you need to request it separately for each region.
If you do not have production access, you should make sure that both From
and To
addresses are verified. The Amazon SES console will list your verified email addresses and verified domains for us-west-2
. The Amazon SES blog has additional guidance on how you can get set up in us-west-2
.
A quick way to tell if you do not have production access: log in to the Amazon SES console dashboard and it will display a blue banner with the following text at the top of the page with a button to request production access:
Your Amazon SES account has "sandbox" access in region US West (Oregon). With sandbox access you can only send email to the Amazon SES mailbox simulator and to email addresses or domains that you have verified. Learn more.
Can't find your existing account settings? Your account may be set up in a different AWS region. Try switching regions in the upper right corner of the console.
Are you by chance still running in 'sandbox' mode? If you are, you can only send emails to addresses that have been pre-verified.
From Amazon:
Email address is not verified—Your account is in the sandbox and one of the recipient email addresses has not been verified. This might apply to "Sender", "Return-Path", or "From" addresses.
If you have not requested production access to Amazon SES, you must verify every recipient email address except for the recipients provided by the Amazon SES mailbox simulator. You must also verify your own "From" address. For more information, see Verifying Email Addresses and Domains in Amazon SES and Testing Amazon SES Email Sending.
More information here: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/ses-errors.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With