我正在尝试从我的Android应用发送电子邮件
public void SubmitInfo(object sender, EventArgs e)
{
StringBuilder htmlBodyMail = new StringBuilder();
htmlBodyMail.AppendLine("Hello from XYZ Application!" + "\n\n" +
"<b>Address:</b> " + App.Address + "\n\n" +
"<b>DataTime:</b> " + App.DataTime + "\n\n" +
"<b>GPS:</b> " + App.Latitude + ", " + App.Longitude);
var emailTask = CrossMessaging.Current.EmailMessenger;
if (emailTask.CanSendEmail)
{
var email = new EmailMessageBuilder()
.To("xxx@xxx.com")
.Subject("XYZ Application")
.BodyAsHtml(htmlBodyMail.ToString())
.WithAttachment(App._file.AbsoluteFile)
.Build();
emailTask.SendEmail(email);
}
}
然而,当我在电子邮件中收到消息时,没有编码到html字符串中的Bold或End of Lines。我在这里做错了什么?