开发者

How do I send email to a dropfolder in asp.net?

I have two questions: 1) How do I send an ema开发者_运维技巧il in C#, but have it end up in a drop folder to be sent from there rather than being sent straight out by SMTP?

2) For a production machine, do I use IIS to process the dropfolder, or should I purchase a 3rd party product for this?

Thanks!


In your web.config:

<system.net>
  <mailSettings>
     <smtp deliveryMethod="SpecifiedPickupDirectory">
      <specifiedPickupDirectory pickupDirectoryLocation="C:\myDropFolder" />
     </smtp>
  </mailSettings>
</system.net>

Whether to use IIS or some third party product... I guess that depends on your needs. Is there a particular feature you would like and that the IIS SMTP server does not have?


You can also set this in code on the DeliveryMethod property of the SmtpClient object.

SmtpClient client = new SmtpClient();
client.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
client.PickupDirectoryLocation = "C:\DropFolder";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜