views:

356

answers:

2

I'm trying to include some SMTP settings in my ASP.NET MVC project by adding the following to my Web.Config file:

  <system.net>
    <mailSettings>
      <smtp>
        <network
             host="host"
             port="25"
             userName="username"
             password="password" />
      </smtp>
    </mailSettings>
  </system.net>

This usually works for me in a standard ASP.NET application however in MVC, it's causing my site to render as blank (no source code in the browser atall).

My application builds ok so I assume I'm just missing a key piece in the MVC model.

A: 

Turns out that the answer is to include the settings inside of the <configSections>, after the <sectionGroup> section.

Putting the code before the <sectionGroup> tagset seems to result in the blank result I was experiencing.

Jamie Dixon
A: 

I got an error when I put this in the <ConfigSections> group, however it worked when I put it immedietly after </ConfigSections>. Are you sure you didn't put it outside the <configSections>?

Solomon