您是否尝试过Amazon SES(简单电子邮件服务)C# Wrapper?
它有一个 SendEmail 方法,该方法返回一个带有 MessageId 的类:
public AmazonSentEmailResult SendEmail(string toEmail, string senderEmailAddress, string replyToEmailAddress, string subject, string body)
{
List<string> toAddressList = new List<string>();
toAddressList.Add(toEmail);
return SendEmail(this.AWSAccessKey, this.AWSSecretKey, toAddressList, new List<string>(), new List<string>(), senderEmailAddress, replyToEmailAddress, subject, body);
}
public class AmazonSentEmailResult
{
public Exception ErrorException { get; set; }
public string MessageId { get; set; }
public bool HasError { get; set; }
public AmazonSentEmailResult()
{
this.HasError = false;
this.ErrorException = null;
this.MessageId = string.Empty;
}
}
我认为您无法获得 MessageId,System.Net.Mail.SmtpClient
您需要
Amazon.SimpleEmail.AmazonSimpleEmailServiceClient
按照 Amazon SES 示例使用: http: //docs.aws.amazon.com/ses/latest/DeveloperGuide/send-using-smtp-net.html