我正在配置我的 c# web api 代码以使用 Amazon Ses api 发送电子邮件,并且我成功发送了电子邮件,但是我遇到了在正文中使用 html 标签的问题,这些标签没有在收到的电子邮件中呈现。下面是示例代码——
const String from = "team.avesta@gmail.com";
String to = "vinaynb@gmail.com";
String subject = "SLM ";
String body = GetMailBody(aMailType, aParams);
private static string GetMailBody(MailType aMailType, MailParams aParams)
{
string body = "";
const string newline = ("<br/>");
body += "Dear Admin," + newline;
body += "Your UserName is:" + aParams.UserName + newline;
body += "Your password is : " + aParams.Password + newline;
body += "Website is: http://demo2dev.com/" + newline;
return body;
}
Destination destination = new Destination(){ToAddresses = new List<string>() {to}};
Content emailSubject = new Content(){Data = subject};
Content textBody = new Content(){Data = body};
Body emailBody = new Body(){Text = textBody};
Message message = new Message(){Subject = emailSubject, Body = emailBody};
SendEmailRequest request = new SendEmailRequest(){Destination = destination, Source =from, Message = message};
AmazonSimpleEmailServiceClient client = new AmazonSimpleEmailServiceClient();
client.SendEmail(request);
标签出现在我的<br/>
电子邮件中并且没有呈现。
任何帮助..?