How to Test a .NET Application That Uses SMTP

How many times you had to set up a SMTP service just to test that your .NET application sends the e-mail correctly? I found that I can test the actual application (not the SMTP delivery) by using a bogus SMTP server in the config file.

It pretends to be a SMTP server but it "delivers" the messages by leaving them into a folder you specify.

<system.net>
  <mailSettings>
    <smtp from="admin@domain.com" deliveryMethod="SpecifiedPickupDirectory">
      <specifiedPickupDirectory pickupDirectoryLocation="c:MailFolder"/>
    </smtp>
  </mailSettings>
</system.net>

Pause until Date Activity Not Triggered

The last in the list of SharePoint quirks happened to me few days ago.

The Symptoms

You have a SharePoint Designer workflow that has a Pause Workflow action until some future date. The date arrives and the workflow doesn’t wake up.

The First Thought

Timer activities in SharePoint workflows were prone to keep sleeping when rehydrated. A fix was promptly released by Microsoft, available here (as I mentioned in this blog).

The Real Culprit

For some obscure reason the SharePoint timer job that wakes up the sleeping workflows got lost. It was not activated. To check this up, fire the CMD window and type:

stsadm -o getproperty -propertyname "job-worfklow" -url http://MOSS_SERVER_URL

in this case it returned

<Property Exist="No" />

just as I feared.

The Solution

stsadm -o setproperty -propertyname "job-worfklow" -propertyvalue "every 1 minutes between 0 and 59" -url http://MOSS_SERVER_URL

Thanks to:
Paul Galvin’s blog (http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!198.entry)
El Blanco’s blog (http://chrissyblanco.blogspot.com/2007/06/issues-with-delay-activity-in-moss.html)

Upload a Document without Lists.asmx

I was looking for a way to quickly upload some documents into a SharePoint document library, when I stumbled upon this fine helper class by Rohit Puri that accomplishes it using WebDAV protocol.

Actually, I managed to build a complete Windows Forms application that resembles the standard SharePoint "Multiple Upload" control. When it’s finished, I will post the source code here.