簡體   English   中英

為什么我在嘗試發送 SES email 時收到“消息被拒絕:Email 地址未驗證”?

[英]Why do I get 'Message rejected: Email address is not verified' when trying to send an SES email?

我正在嘗試將 email 從電子郵件 1 發送到電子郵件 2。 但我收到以下錯誤:

交易失敗。 服務器響應是:消息被拒絕:Email 地址未驗證。 以下身份在區域 CA-CENTRAL-1 中未通過檢查:alex.smail@yahoo.ca、發件人姓名 email1@yahoo.ca、email2@yahoo.com

這是我的代碼:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Net.Mail;

namespace ConsoleApp3
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Email("DO TEST");
        }

        public static void Email(string htmlString)
        {


            String FROM = "email1@yahoo.ca";
            String FROMNAME = "Sender Name";

    
            String TO = "email2@yahoo.com";

  
            String SMTP_USERNAME = "kiffretM5C2PFESI5W";


            String SMTP_PASSWORD = "BLeMDSkjioourdvhvbhvhTMHAVfuG6mcAXibbTmQpe7WX";


            String HOST = "email-smtp.ca-central-1.amazonaws.com";

     
            int PORT = 587;

            
            String SUBJECT =
                "Amazon SES test (SMTP interface accessed using C#)";

            // The body of the email
            String BODY =
                "<h1>Amazon SES Test</h1>" +
                "<p>This email was sent through the " +
                "<a href='https://aws.amazon.com/ses'>Amazon SES</a> SMTP interface " +
                "using the .NET System.Net.Mail library.</p>";

  
            MailMessage message = new MailMessage();
            message.IsBodyHtml = true;
            message.From = new MailAddress(FROM, FROMNAME);
            message.To.Add(new MailAddress(TO));
            message.Subject = SUBJECT;
            message.Body = BODY;
     

            using (var client = new System.Net.Mail.SmtpClient(HOST, PORT))
            {
                
                client.Credentials =
                    new NetworkCredential(SMTP_USERNAME, SMTP_PASSWORD);

                
                client.EnableSsl = true;


                try
                {
                    Console.WriteLine("Attempting to send email...");
                    client.Send(message);
                    Console.WriteLine("Email sent!");
                }
                catch (Exception ex)
                {
                    Console.WriteLine("The email was not sent.");
                    Console.WriteLine("Error message: " + ex.Message);
                }
            }
            }
    }
}

看起來您正在沙盒模式下使用 Amazon SES。

移出 Amazon SES 沙箱 - Amazon Simple Email 服務

為了幫助防止欺詐和濫用,並幫助保護您作為發件人的聲譽,我們對新的 Amazon SES 賬戶應用了某些限制。

我們將所有新帳戶放在 Amazon SES沙箱中。 當您的賬戶位於沙盒中時,您可以使用 Amazon SES 的所有功能。 但是,當您的帳戶處於沙盒中時,我們會對您的帳戶應用以下限制:

  • 只能將郵件發送到經過驗證的 email 地址和域,或者發送到 Amazon SES 郵箱模擬器。
  • 您每 24 小時最多可以發送 200 條消息。
  • 您每秒最多可以發送 1 條消息。

在沙盒模式下運行時,您需要驗證每個 email 地址才能接收 email。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM