Я использую Amazon SES для отправки электронной почты. Как отправить электронное письмо с вложением на C# с помощью Amazon SES?
Код:
AmazonSimpleEmailServiceConfig amConfig = new AmazonSimpleEmailServiceConfig();
amConfig.UseSecureStringForAwsSecretKey = false;
AmazonSimpleEmailServiceClient amzClient = new AmazonSimpleEmailServiceClient("username", "password", amConfig);
ArrayList to = new ArrayList();
to.Add("[email protected]");
Destination dest = new Destination();
dest.WithBccAddresses((string[])to.ToArray(typeof(string)));
string body = "INSERT HTML BODY HERE";
string subject = "INSERT EMAIL SUBJECT HERE";
Body bdy = new Body();
bdy.Html = new Amazon.SimpleEmail.Model.Content(body);
Amazon.SimpleEmail.Model.Content title = new Amazon.SimpleEmail.Model.Content(subject);
Message message = new Message(title, bdy);
SendEmailRequest ser = new SendEmailRequest("[email protected]", dest, message);
SendEmailResponse seResponse = amzClient.SendEmail(ser);
SendEmailResult seResult = seResponse.SendEmailResult;