Showing posts with label Debugging. Show all posts
Showing posts with label Debugging. Show all posts

2016-03-02

Catching mails

When developing a solution, sometimes it is nice to be able to catch mails and store them somewhere in stead of potentially sending them to real customers.

In web.config or app.config, there is a setting that can accomplish that for you:

<system.net>
  <mailSettings>
    <smtp deliveryMethod="SpecifiedPickupDirectory">
      <specifiedPickupDirectory pickupDirectoryLocation="c:\Temp\Mail"/>
    </smtp>
  </mailSettings>
</system.net>
 If you install an eml-viewer or maybe just a regular mail client, you can open and read the mails from the folder you specified.

Source:
http://stackoverflow.com/questions/567765/how-can-i-save-an-email-instead-of-sending-when-using-smtpclient

2013-03-21

Fiddler tricks

Capture traffic from localhost:
  • Add a dot after “localhost”, so it becomes http://localhost.
    • This does not always work. On my Windows Server 2008 R2 box, it does not.
  • Access your web using the (netbios) machine name.
  • Access your web through the fiddler proxy: http://ipv4.fiddler/AppName
  • Run your web’s application pool under the same account that fiddler is running under, ie. the account you are logged on as.
    • NB! This also has the MAJOR benefit that you will see web service calls from your website.
    • IIS Express by default runs as the logged on user, so Fiddler will capture traffic.
Source:
http://weblogs.asp.net/lorenh/archive/2008/01/10/tip-for-using-fiddler-on-localhost.aspx