Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a large web application I need to run locally. The application has a large amount of email services and I want to make sure I don't send any email accenditally as I don't know all the inner workings of the code yet. How can I turn off SMTP functions on Windows 7.

share|improve this question
up vote 1 down vote accepted

DONT DO IT. YOu can not. But you can redirect them to a drop directory - i.e. everytime you send an email, a file is generated in a directory. That actually makes also sense in production (local SMTP Service, using the same directory for pickup - emails are generated faster than a SMTP connection). Check the web.config - locally or globally - for how to configure how SMTP deals. THis is also in IIS configuration manager ;)

For a short term fix (with possible side effects) change the WIndows FIrewall to block outgoing connections to port 25 (SMTP). Carefull - that will also affect any email client running, obviously.

share|improve this answer
Yes I know how to do this. But a lot places in the code these values are hard coded and therefore changing web.config will have no effect. – user40925 Apr 19 '10 at 7:39
Better start changing the code then. You possibly also could use the WIn7 integrated firewall - block all outgoing traffic to port 25 (smtp). But these values hardcoded makes no sense ;) Even pre-.net2.0 (where this was introduced in web.config) a sane programmer would pull the values from (his own at these times) entries in the web.config, not hardcode them. – TomTom Apr 19 '10 at 9:02
As TomTom said, blocking port 25 outbound would be a good start. This suggestion really belongs in his main answer, because it is the best immediate solution to your immediate problem. – Skyhawk Apr 19 '10 at 14:55

Your Answer


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.