I'm hosting a .net web app on Win Server 2008 R2. I added the SMTP feature so I could send emails via code. This worked fine, and I was able to send a very simple email.
Well I then messed with installing Exchange Server on my Win Server, to create email accounts, then decided that was a bad idea. I started the install process, saw how complex it was, then scrapped the idea. Well, after that I started to get errors when emailing in my .net app.
I started seeing this error:
Mailbox unavailable. The server response was: 5.7.1 Unable to relay for firstname.lastname@example.org
Then I read that I needed to add this code:
client.DeliveryMethod = SmtpDeliveryMethod.PickupD
I did that, now I get this error:
Cannot get IIS pickup directory.
I am administering the Win Server (for the first time), so I don't need any network server. Any suggestions as to what it wrong?
** Another thing to note ** I used to see the SMTP feature icon under IIS. I could start and stop it there. Now I can't find that anywhere. I just see the SMTP-E-Mail Icon in the ASP.NET area of IIS. Do I need to configure something here? I told it to use localhost, but I still get the error.
//Send the message.
SmtpClient client = new SmtpClient("localhost");
client.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;