Monday, 1 December 2008

TSQL: How to send e-mail without using SQL Mail in SQL Server

Was looking for a way to send email out of SQL without using xp_sendmail. Came across this KB article on Microsoft's site:

http://support.microsoft.com/kb/312839

Misc: Debugging using Filemon

After fixing this issue, somehow it reappeared and I checked everything I knew how to check and couldn't figure it out until I found a post than mentioned using Filemon to figure out where the denied access was happening, so I thought I would post how I fixed it incase other people are still having problems:

1) Download Filemon from http://www.sysinternals.com/Utilities/Filemon.html to your server. Unzip and run it.

3) Press Ctrl+L or click the "Filter" button in the menu bar (it looks like a funnel).

4) Uncheck "Log Reads" and "Log Successes" so you don't have hundreds of entries coming up every second. Click OK.

5) Press Ctrl+X or click on the "Clear" button to clear the list.

6) Try your ASP script again and voila, you should have an entry whose result is "ACCESS DENIED" in your list along with the file path and user.

7) Now you can find and right-click on the folder, go to properties->security and grant that user write permission in that directory.

In my case the folder was the "pickup" folder NOT in Intepub (as so many message boards suggest), but in Program Files->Exchsrv directory, and the user was not IUSR_COMPUTERNAME (as so many boards suggest), but NETWORK SERVICE as the exchange application pool on my server is running under the "network service" identity.

Whatever your unusual configuration, you should be able to pinpoint the problem using Filemon.