Cannot get IIS pickup directory(无法获取 IIS 拾取目录)
问题描述
我一直在使用 Smtp 服务器 127.0.0.1 .我得到的错误:
I’ve been using the Smtp server 127.0.0.1 .The error I get:
System.Net.Mail.SmtpException: 无法在 System.Net.Mail.IisPickupDirectory.GetPickupDirectory() 获取 IIS 分拣目录.
此错误发生在从 ASP 网页发送电子邮件时.但从 ASP.NET 页面发送电子邮件时,没有发生错误.请帮忙.
This Error occured ,when Email send from ASP web page.But EMail send from ASP.NET page,error is not occurred. Plz help .
推荐答案
不幸的是,当尝试确定 IIS/SMTP 拾取目录的位置时出现任何类问题时,会引发此异常.一个常见的原因是缺少 IIS SMTP 服务.
Unfortunately, this exception is raised when any kind of problem occurs while trying to determine the location of IIS/SMTP pickup directory. A common cause is missing IIS SMTP service.
如果您使用 System.Net.Mail.SmtpClient 发送邮件,请尝试手动设置取件目录:
If you are sending mail using System.Net.Mail.SmtpClient, try setting the pickup directory manually:
// C#
var client = new SmtpClient();
client.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
client.PickupDirectoryLocation = ...;
client.Send(...);
或者改为在 ASP.NET 的 Web.config 中设置:
Or set this in ASP.NET's Web.config instead:
<configuration>
<system.net>
<mailSettings>
<smtp deliveryMethod="SpecifiedPickupDirectory">
<specifiedPickupDirectory
pickupDirectoryLocation="..." />
<network defaultCredentials="false" />
</smtp>
</mailSettings>
</system.net>
</configuration>
或者,使用 SmtpDeliveryMethod.Network
方法并将 Host
和 Port
属性发送到您的 SMTP 服务器.
Alternatively, use SmtpDeliveryMethod.Network
method instead and sent the Host
and Port
properties to your SMTP server.
更多信息:http://forums.iis.net/p/1149338/1869548.aspx
这篇关于无法获取 IIS 拾取目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法获取 IIS 拾取目录
基础教程推荐
- c# Math.Sqrt 实现 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 如何激活MC67中的红灯 2022-01-01