Saturday, December 11, 2010

How to check Email functionality without using SMTP Server ?

How to do That ?

Some situations arise when you need check email functionality without using SMPT server.So at that time you can use below mentioned configuration on web.config file. 
Just configure your .NET application to drop e-mails into a specified folder instead of sending them via SMTP server:

web.configuration File

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

Note:
This will instruct SmtpClient class to generate mail message and save it as .eml file and drop it 
into c:\Test\  folder.

1 comment:

Thanks for your Feedback.