SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Apr 2010
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need Help ASP.net problem!

    Hi to all,

    I have a problem regarding for my email contact form. I don't know where the problem is as I checked all my codes as well as my smtp settings for this email contact form. But the errors still exist on my web.config. Any correction, suggestion or a simple email form scripts for my codes guys will be a great help. Please help me. Thanks to all in advance. below are my codes.

    Error: Unrecognized element 'To'. (C:\web files\web.config line 11)

    I'm using IIS as my web server.

    Below is my web.config setting. I edited the email info and pass for confidentiality and considering that's work fine. The Red text/line was the error indicating on line 11.


    <?xml version="1.0"?>
    <configuration>
    <configSections> <section name="EmailConfig"
    type="WebWorks.Common.Configuration.EmailConfig,
    WebWorks.Common.Configuration"/>
    </configSections>

    <EmailConfig>
    <Notifications>
    <Notification Name="Request" Subject="Book Online
    Request" IsBodyHtml="true" IndividualMail="true"
    Template="~/Templates/Request.htm"/>

    <To>
    <Email Name="admin" Address="myname@gmail.com"/>
    </To>
    </Notifications>

    </EmailConfig>

    <system.net>
    <mailSettings>
    <smtp from="myname@gmail.com">
    <network host="smtp.gmail.com" port="465" enableSsl="true"
    userName="myname@gmail.com"
    password="mypassword"/>
    </smtp>
    </mailSettings>
    </system.net>

    <system.web>
    <compilation debug="false"/>
    </system.web>

    <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    </system.webServer>
    </configuration>

  2. #2
    SitePoint Member williamjerry's Avatar
    Join Date
    Jul 2011
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can put them in app settings and can fetch them in code.

  3. #3
    SitePoint Member
    Join Date
    Apr 2010
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Williamjerry,

    Thanks for the info but can you give me an example on how can I put them in app? sorry for being confused about this. Thanks again in advance.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •