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

I'm trying to configure the IIS 7 SMTP settings for .NET 4 web applications, so all sites use the same host. I've configured the host for the server inside the IIS manager, but this is only picked up by .NET 2 web apps.

.NET 4.0 applications don't pickup the host.

Is there a way to specify a machine-wide SMTP setting for .NET 4? The server is x64.

share|improve this question

1 Answer 1

I discovered the answer: you need to add the <system.net> section to your machine.config file, for the framework, e.g.

<system.net>
        <mailSettings>
            <smtp from="blah@blah">
                <network host="123.321.123.321" port="25" defaultCredentials="true" />
            </smtp>
        </mailSettings>
</system.net>

IIS7 stores its SMTP settings in the metabase.xml file still, however you can configure it for a framework via the machine.config as that takes precedence.

You just need to remember that if you're on 64 bit server, the path is

C:\Windows\Microsoft.NET\Framework64

share|improve this answer

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.