c# - 使用 aws 从 c# 发送电子邮件正在向链接添加警告-https
问题描述
我有一个网络表单应用程序。并且所有电子邮件都运行良好,除了 1。其中之一是在链接中添加了一个警告-https,我不知道为什么。
我正在从 ac# webforms 应用程序发送电子邮件
String FROM = "noreply@somedomain.edu";
String FROMNAME = "Webmaster";
MailMessage message = new MailMessage();
message.From = new MailAddress(FROM, FROMNAME);
foreach (var item in adminEmails)
{
message.To.Add(new MailAddress(item));
}
message.Subject = ("A new paper has been added for the Landpower Symposium 2022");
message.IsBodyHtml = true;
message.BodyEncoding = Encoding.UTF8;
message.Attachments.Add(new Attachment(newStream, filename));
message.Body = "<p> A new paper has been attached for your review. </p> "
+ " <p>title :" + title + "</p> "
+ " <p> filename :" + filename + "</p>"
+ "<p> Posted by: " + firstName + " " + lastName + " <a href='mailto:" + email + "'>" + email + "</a> " + phone + "</p>"
+ "<p> After reviewing, you may approve or reject this paper by clicking "
+ "<a href = '" + getBaseUrl() + "/landpower/login.aspx?Page=AdminApprovePapers.aspx&FileId=" + fileid.ToString() + "'> here </a>";
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
// try to send an AWS email
// Amazon SES SMTP user name.
String SMTP_USERNAME = "***************";
// Amazon SES SMTP password.
String SMTP_PASSWORD = "*************************";
String HOST = "email-smtp.us-east-1.amazonaws.com";
int PORT = 587;
using (SmtpClient client = new SmtpClient(HOST, PORT))
{
client.Credentials = new NetworkCredential(SMTP_USERNAME, SMTP_PASSWORD);
client.EnableSsl = true;
System.Diagnostics.Debug.WriteLine("Attempting to send email...");
client.Send(message);
System.Diagnostics.Debug.WriteLine("Email sent!");
}
(我将实际站点更改为 somedomain)
在 Outlook 中收到消息时,链接是警告-https://somedomain.edu/landpower/login.aspx?Page=AdminApprovePapers.aspx&FileId=6
有谁知道是什么原因造成的?我正在从应用程序发送其他电子邮件,一切正常。
解决方案
推荐阅读
- wix - 添加 Wix 包含文件不会引发“十六进制值 0x00,是无效字符”。
- javascript - 我可以在 Redux Store 操作中使用 OOP
- geolocation - 尝试添加地理位置数据时出现问题 - “无法从您发送到几何字段的数据中获取几何对象”
- automation - 如何使用命令行创建/克隆实例?蓝叠5
- python - 如何配置 pip 以首先在本地目录中查找模块
- java - java.sql.SQLException:'字段'voc_id'没有默认值'。使用 Spring JPA
- python - ZeroDivisionError 发生时如何防止打印出消息?
- solr - 如何在 OpenJDK 11 上使用 VisualVM 中的 VisualGC 和 SOLR
- mysql - 如何通过在nodejs中上传CSV文件一次添加多个用户?
- mysql - Power BI 中无法连接到 MySQL 本地服务器 3306