Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a website that sends out email

The C# code to do this is:

var mailClient = new SmtpClient { DeliveryMethod = SmtpDeliveryMethod.Network, Host = "localhost", Port = 25 };

mailClient.Send(_mailMsg);

The code works fine as this website deployed on a Windows Server 2003 IIS6 works perfectly.

I have configured the SMTP service in IIS7 to deliver to localhost using port 25 and set authentication settings as not required.

Would anybody have any further assistance to help in being able to send emails with iis7 and windows server 2008?

share|improve this question
    
And the question/problem is? BTW you can format code by using the 101010 button, or by indenting it with 4 spaces –  Sander Rijken Dec 27 '09 at 0:42
add comment

1 Answer

up vote 2 down vote accepted

IIS7 SMTP is the same as IIS6 SMTP. It wasn't updated, so even the management is done with IIS 6 Manager (even though everything else is IIS7). Edit the server properties and make sure that 127.0.0.1 is added as an approved relay IP address. That will allow it to work without authenticating as long as it's sent from the local machine.

Note: That was required with IIS6 too though so possibly you did this with the IIS6 server at some point in the past.

That's the only change I make to a new IIS SMTP server to ensure that it works from the local machine. (not counting spam settings like reverse and forward DNS entries)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.