无法获取IIS拾取目录 [英] Cannot get IIS pickup directory
问题描述
我一直在使用SMTP服务器127.0.0.1 .The错误我得到:
I’ve been using the Smtp server 127.0.0.1 .The error I get:
System.Net.Mail.SmtpException:无法获取IIS皮卡directory.at System.Net.Mail.IisPickupDirectory.GetPickupDirectory()
这个错误发生,当电子邮件从ASP网页page.But邮件发送从ASP.NET页发送,不发生错误。 plz帮助。
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
方法,而不是就差主机
和端口
属性,您的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拾取目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!