views:

1380

answers:

3

I do not have access to an IIS development server -- only the production one. So, for my development, I have to use the ASP.NET Development Server thats built into Visual Studio. I get Failure to send message when I have the SMTP client configured this way.

SmtpClient.Host = "localhost";
SmtpClient.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
SmtpClient.PickupDirectoryLocation = HttpContext.Current.Server.MapPath("~/MessagesSent/");

Is there any way I can use the Development server to drop off messages so I can test them?

Edit: Or is there another way I can test sending an e-mail on the Development Server?

A: 

All versions of Windows (NT, since NT4) have IIS as an option. So you can run you development with a copy of IIS installed on your development system.

Richard
Not XP Home, I which I have.
Daniel A. White
A: 

Just omit the .DeliveryMethod and .PickupDeliveryLocation properties altogether - you shouldn't need them just to send a message. Does it work without them?

If your IIS SMTP server is set up correctly to send mail on your dev box then you should be fine without it. Also, if IIS doesn't have access to the directory this can cause the error.

routeNpingme
A: 

My ~/MessagesSent/ did not exist. That was the problem.

Daniel A. White