1

I have a large asp.net 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.

1 Answer 1

1

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.

3
  • 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, 2010 at 7:39
  • 1
    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, 2010 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, 2010 at 14:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .