|
-
Apr 9th, 2009, 05:54 AM
#1
Thread Starter
PowerPoster
Cannot get IIS pickup directory.
Code:
MailAddress SendFrom = new MailAddress("[email protected]");
MailAddress SendTo = new MailAddress(To);
MailMessage MyMessage = new MailMessage(SendFrom, SendTo);
MyMessage.Subject = subject;
MyMessage.Body = message;
SmtpClient emailClient = new SmtpClient("127.0.0.1");
emailClient.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
emailClient.PickupDirectoryLocation = "C:\\Inetpub\\mailroot\\Pickup\\";
emailClient.Send(MyMessage);
I get the following error message on the .Send
Cannot get IIS pickup directory.
The directory exists and it occurs with or without me specifiying emailClient.PickupDirectoryLocation
There is an SMTP server on the box and its running. Its a fasthosts dedicated box if that makes a differnence.
Any suggestions?
-
Apr 11th, 2009, 07:22 AM
#2
Re: Cannot get IIS pickup directory.
That, then, usually happens if the account in IIS doesn't have permissions to access that location. If you're with fasthosts, then it is a possibility that they have configured a non-default user to run the web apps. It will also mean that they're controlling what touches what. I'm also willing to bet that you don't need a pickup directory to send emails, they must have a server you can use that isn't 127.0.0.1, but you'll need to ask them about this specific bit (the permissions)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|