Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4590226
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:13:09+00:00 2026-05-21T22:13:09+00:00

I have an asp.net 4.0 site which has an email facility. I tested using

  • 0

I have an asp.net 4.0 site which has an email facility.
I tested using one mail server, then when I put it on the customers server with the code changed to point to the customers smtp server, its as if its still looking for the old smtp server, which aint there.
There is no mention of it in the code any more, am I missing something?

  • changed the code on the development machine, re-built project, sorted! thanks *

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T22:13:10+00:00Added an answer on May 21, 2026 at 10:13 pm

    You should be defining the SMTP server settings in your Web.config, like this (instead of in code):

    <system.net>
        <mailSettings>
            <smtp from="me@mydomain.com">
            <network host="smtp.mydomain.com"/>
            </smtp>
        </mailSettings>
    </system.net>
    

    You can also specify the credentials here. And then just instantiate a new SmtpClient like this:

    SmtpClient client = new SmtpClient();
    

    It will use the configuration from the Web.config.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET Site that has a single Master Page. On one of
I have an ASP.NET site that has been running perfectly for a long time,
I have a multilingual ASP.NET site; one of the languages is Arabic (ar-SA). To
We have a legacy ASP.net powered site running on a IIS server, the site
I am working with an asp.net 2.0 site (call it site 1) which has
So I have an ASP.NET 'Web Site' (as opposed to a Web Application) which
I have an ASP.Net MVC site, which connects to a web service. The site's
I have a site which is running in ASP.NET 4.0, on Windows 7 Ultimate.
I have put together a small ASP.NET MVC 2 site that does some very
I have an ASP.NET site that I'm developing. The layout is pretty basic. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.