SMTP Pickup Directory

Our web site is hosted under 2 different web servers.
We use a custom DLL to send mails.  This DLL is registered to both web servers.

I'm having problems sending emails because the two web servers have different pickup directories.
one uses drive c:\ while the other uses d:\.  In my code, I don't specify the pickup directory, so it always gets the default which is c:\inetpub\mailroot\pickup.  When the other server is up, it fails to send the message because it is using d:\inetpub\mailroot\pickup.  

Our administrators do not want to modify their SMTP settings. So, I guess we have to work on the code to dynamically switch to pickup directories of the current web servers.  For this, I need to have a function that will get the pickup directory of the web server. Do I need to set any other property aside from the pickupdirectory?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You could do a query on the metabase to check the pickup directory.

In ASP you could do this with the following:

IIsObjectPath = "IIS://localhost/smtpsvc/1"
Set iisobject = GetObject(IIsObjectPath)

PDir will be set to the value of the SMTP pickup directory for the 1 SMTP instance on the local machine.

Dave Dietz

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft IIS Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.