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
You should be defining the SMTP server settings in your Web.config, like this (instead of in code):
You can also specify the credentials here. And then just instantiate a new
SmtpClientlike this:It will use the configuration from the Web.config.