首页 > 解决方案 > 使用 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

有谁知道是什么原因造成的?我正在从应用程序发送其他电子邮件,一切正常。

标签: c#amazon-web-servicesoutlookwebforms

解决方案


推荐阅读