Thursday, July 23, 2015

SMTP configuration for mail relay on web server

The following errors can occur on a fresh web server where you are trying to send SMTP email in the code (a contact form for example).

  • No connection could be made because the target machine actively refused it 127.0.0.1:25 - SMTP server has not been installed on the server. 
    • Open server manager
    • Click manage > Add roles and Features
    • Select role-based or feature based installation
    • Select the local server
    • Select Features from the left menu (not Server Roles)
    • Check the SMTP Server feature
  • Mailbox unavailable. The server response was: 5.7.1 Unable to relay for test@email.com - because mail relay has not been setup on the server
    • Open the IIS6 Manager
    • Select properties for SMTP Server
    • Select the General tab set the IP address setting to be the servers IP instead of All Unassigned
    • On the Access tab, click the Relay button, then add the server's IP address and 127.0.0.1
  • Unable to read data from the transport connection: net_io_connectionclosed - the web site in IIS is still trying to connect to a SMTP server.
    • Open IIS Manager
    • Select the web site
    • Under ASP.NET select SMTP E-mail
    • Select the Store e-mail in pickup directory option and set the value to C:\inetpub\mailroot\Pickup
    • On the C:\inetpub\mailroot\Pickup directory give access to the account IIS_IUSRS

No comments:

Post a Comment