NET v4.0中无法识别的属性'enableSsl'

编程入门 行业动态 更新时间:2024-10-17 09:49:51
本文介绍了NET v4.0中无法识别的属性'enableSsl'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们已经运行了一段时间的新系统正在测试中,并且正在将电子邮件创建到文件夹中,这样它们就不会意外地发送给客户.现在我们打开了实时电子邮件,在发送时遇到了问题.

We've been running a new system in test for a while now and creating emails to a folder so they don't accidentally go out to clients. Now we've turned on live emailing we are getting issues with sending.

我正在使用ActionMailer.NET,下面是创建和发送电子邮件的代码.我不会包含视图":

I'm using ActionMailer.NET and the code to create and send the email is below. I won't include the View:

EmailResult x = new EmailController().EmailWorkOrderForApprovalToClient(model); System.Net.Mail.Attachment file = new System.Net.Mail.Attachment(FilePath); x.Mail.Attachments.Add(file); x.Deliver();

哪个出现错误

SMTP服务器需要安全连接,或者客户端不安全已验证.服务器响应为:5.7.57 SMTP;客户不是经过验证可在MAIL FROM期间发送匿名邮件

The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM

web.config看起来像这样:

The web.config looks like this:

<system> <mailSettings> <smtp deliveryMethod="Network" from="ClientServices@topupconsultants"> <specifiedPickupDirectory pickupDirectoryLocation="" /> <network defaultCredentials="false" host="smtp.office365" password="secret" port="587" userName="ClientServices@myco" /> </smtp> </mailSettings>

我的假设是enableSsl ="true"需要添加到网络线路,但是当我这样做并尝试转到IIS中站点的SMTP电子邮件部分时,出现错误:

My assumption is that enableSsl="true" needs to be added to the network line, but when I do that and try to go to the SMTP Email section of the site in IIS, I get the error:

无法识别的属性"enableSsl"

Unrecognized attribute 'enableSsl'

我在IIS上并不那么热门,但是我检查了应用程序池及其.NET CLR版本是否为4.0.30319.我还检查了服务器上是否安装了.NET v4.5.

I'm not that hot on IIS, but I've checked that the Application Pool and its .NET CLR version is 4.0.30319. I've also checked that .NET v4.5 is installed on the server.

这让我感到困惑,我希望我不必完全将代码更改为允许我在此时指定SSL的方法.

This is baffling me, and I'm hoping I don't have to totally change my code to a method that allows me to specify SSL at that point.

推荐答案

在这里回答我自己的问题,基本上答案是:不相信错误消息".在我尝试过的所有配置中,我都认为错误消息告诉我这是不可接受的.但是,无论如何,我还是尝试了它,并且它在发送时使用了enableSsl属性,这使与Office 365的连接得以成功.

Answering my own question here, and basically the answer is: "Don't believe the error message". In all the configurations I tried, I believed the error message when it told me that is was unacceptable. However, I tried it anyway, and it uses the enableSsl attribute when it sends, and this allows the connection to Office 365 to succeed.

一个令人烦恼的IIS错误,我会在一周内忘记它,但是现在非常烦人.

Slightly irritating IIS bug that I'll forget about in a week, but right now is very annoying.

更多推荐

NET v4.0中无法识别的属性'enableSsl'

本文发布于:2023-11-28 13:53:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1642667.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:属性   无法识别   NET   enableSsl

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!