How to send an email to the drop folder in asp.net?

I have two questions: 1) How to send an email to C #, but in the end it will end up in the forwarding folder, and not sent directly from SMTP?

2) For a production machine, do I use IIS to handle the dropfolder folder, or should I buy a third-party product for this?

Thank!

+3
source share
2 answers

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

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

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 think it depends on your needs. Is there any feature you would like and that the IIS SMTP server does not have?

+8

Source: https://habr.com/ru/post/1761048/


All Articles