tags:

views:

30

answers:

2

I have two questions: 1) How do I send an email 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!

+2  A: 

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?

Heinzi
It is a production machine, emails are no more than 5 addresses at a time to customers, may be as many as 32,000 emails a day sent out as business picks up in the next few months. Also - no MS Exchange, we are using gmail for domains. Will this suffice, or is there a 3rd party solution I should use for sending smtp emails?
mikeh
+1  A: 

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";
rrrr