我正在使用Amazon SES發送電子郵件。如何使用Amazon SES在C#中使用附件發送電子郵件?使用Amazon SES在C#中使用附件發送電子郵件
代碼:
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;
您使用SES發送電子郵件的方式與使用C#發送其他電子郵件的方式相同。您需要發佈C#代碼,具體問題以及您可能從代碼中收到的特定錯誤。 – paulsm4 2012-03-18 04:08:22
謝謝。我想要代碼發送電子郵件附件 – sharmila 2012-03-18 04:12:50