SmtpClient类不能从Web.Config文件拿起默认参数 [英] SmtpClient class not picking up default parameters from Web.Config file

查看:224
本文介绍了SmtpClient类不能从Web.Config文件拿起默认参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

配置文件:

<system.net>
<mailSettings>
<smtp from="YYYYY@xxxxxx.com">
<network
host="mail.xxxxxx.com"
port="25"
password="password"
userName="user@xxxxxx.com"
defaultCredentials="false"
/>
</smtp>
</mailSettings>
</system.net>

我已经尝试过defaultCredentials =真正的,但我收到以下消息:

I've already tried defaultCredentials="true" but i recieved following message:

System.FormatException:SMTP服务器返回无效响应

System.FormatException: Smtp server returned an invalid response.

如何解决这个问题呢?

推荐答案

抱歉,不得不从ASP.NET MVC视图文件夹中的web.config开放,而不是一个在应用程序根 - DOH !!!!!

sorry, had the web.config from the Views folder in ASP.NET MVC open, not the one in the application root - DOH!!!!!

做工精细现在:))

这篇关于SmtpClient类不能从Web.Config文件拿起默认参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆