Starting and Stopping SMTP on Dev Server: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
 
Line 77: Line 77:
==== Management console ====
==== Management console ====


* Administrative Tools > IIS 6.0 Manager > SMTP Virtual Server > right click > Stop
* '''Administrative Tools''' > '''IIS 6.0 Manager''' > '''SMTP Virtual Server''' > ''right click'' > '''Stop'''
* (Optionally) Administrative Tools > Services > Simple Mail Transport Protocol > Stop
* (Optionally) '''Administrative Tools''' > '''Services''' > '''Simple Mail Transport Protocol''' > '''Stop'''


=== Router ===
=== Router ===

Latest revision as of 12:23, 4 October 2015

Starting SMTP[edit]

Server-side code[edit]

Make sure the code is using the development SMTP server
e.g. in Web.config:

<configuration>
	<appSettings>
		<add key="SMTPServer" value="devserver"/>
	</appSettings>
</configuration>

Router settings[edit]

This is only necessary if the SMTP server is being reached remotely. If the STMP server referenced as part of the LAN then port 25 on the router can remain disabled.

  • Log into (medialink) router: http://192.168.123.1
  • Click ‘Virtual Server’ option
  • Enable port 25 (pointing to the local dev web server)

Development web server settings[edit]

  • Remote Desktop to local dev web server.
  • Start the SMTP service.
  • Start the SMTP Virtual Server.

Command line[edit]

After doing the following, the SMTP Server reports being started in the MMC, but mail doesn't actually get delivered. Requires some more research. In the meantime, use the MMC.

Using PowerShell as Administrator:

> # start the SMTP service
> net start smtpsvc
> # or, alternatively:
> net start "Simple Mail Transfer Protocol (SMTP)"
> # start the SMTP virtual server:
> $SMTP=[adsi]"IIS://localhost/SMTPSVC/1"
> $SMTP.ServerState = 2
> $SMTP.SetInfo()

Management consoles[edit]

  • Administrative Tools > Services > Simple Mail Transport Protocol > Start
  • Administrative Tools > IIS 6.0 Manager << Note the version number!
    • SMTP Server > right click > Start
    • The following steps are usually a one-time operation:
    • SMTP Server > right click > Properties
      • Access tab > Relay Restrictions > Relay...
      • Only the list below selected
      • Click Add... button
      • Select Group of computers
        • Subnet address: first IP address in group, e.g. 192.168.123.100
        • Subnet mask: wide enough to allow access for all computers in group, e.g. 255.255.255.200

Stopping SMTP[edit]

  • Remote Desktop to the machine running the SMTP Virtual Server.
  • Stop the SMTP Virtual Server.
  • Stop the SMTP Service.
  • On the router, disable the SMTP port.

Stop SMTP Server[edit]

Command line[edit]

Using PowerShell as Administrator:

> # stop the SMTP service
> net stop smtpsvc
> # stop the SMTP virtual server
> $SMTP=[adsi]"IIS://localhost/SMTPSVC/1"
> $SMTP.ServerState = 4
> $SMTP.SetInfo()

Management console[edit]

  • Administrative Tools > IIS 6.0 Manager > SMTP Virtual Server > right click > Stop
  • (Optionally) Administrative Tools > Services > Simple Mail Transport Protocol > Stop

Router[edit]

This step is necessary only if the SMTP server address is off the LAN.

See also[edit]