Advantages of configuring a local SMTP server
FotoWeb requires an email server for many of its core functions. FotoWeb does not support Secure Sockets Layer (SSL) encrypted authentication to Simple Mail Transfer Protocol (SMTP) servers, so you must set up an SMTP service on the FotoWeb server that can relay all emails sent by FotoWeb to your primary SMTP server.
Additionally, setting up a relay server ensures that all emails from FotoWeb will be delivered, as the relay server will receive all outgoing emails from FotoWeb and keep trying to relay them if the main mail server is down for maintenance.
Choice of email service
Any SMTP service that supports relaying can be installed on the server. The following documentation describes configuring the SMTP service with Internet Information Services (IIS) in Windows.
There is also the option to use, for example, hMailServer, a standalone third-party email service that supports relay. For installation and configuration instructions, see the hMailServer website.
Note: The procedure below may not work if IPv6 is enabled on the server - this is especially the case with recent Windows Server. If you need to disable IPv6 on the server, see the relevant Microsoft documentation.
Adding the IIS SMTP feature to your server
The following steps describe installing and configuring the IIS SMTP service for relaying emails.
Note: The SMTP relay service in IIS 6, described below, does not support IPv6 environments.
It can only be used in networks with IPv4.
- Open the Server Manager and select Add roles and features.
- Select Role-based or feature-based installation and select Next. Choose your server in the next window and select Next.
- Select Web server (IIS) from the list of roles and select Next. Confirm any additional features that need to be enabled.
- Select the SMTP Server feature in the list of features. Confirm any additional features that need to be installed.
- Select Next to start configuring the web server role.
- Select Next to proceed with the default web server settings. IIS will now also be installed and configure web services on port 80.
- Select Install to add the roles and features to the server.
Configuring the SMTP server
- Open IIS Manager 6: Hit Windows-R, enter inetmgr6, and select OK.
Note: The SMTP configuration uses IIS Manager 6, not the 7.0 version. After adding the SMTP server to your system your system will likely have both consoles installed. You need to use version 6 to configure the SMTP server.
- In IIS manager, right-click on SMTP Server and choose Properties:
- On the General tab, leave the settings as they are so that IP address is set to All unassigned.
- Open the Access tab:
- Select Authentication and make sure Anonymous access is checked. Select OK:
- Open the Access tab and select Connection.
- Select Only the list below and select Add. Enter 127.0.0.1 as the IP address and select OK:
This connection setting controls which computers can connect to the SMTP server and send emails. By giving only localhost (127.0.0.1) access, only the sever itself (and FotoWeb running on the server) can connect to the SMTP service.
- Select OK to return to the Access list tab. Select Relay. Enter 127.0.0.1 as the IP address here and select OK:
The relay setting controls which computers can relay mail through this SMTP server. By only giving localhost this permission, it means that only the server itself can relay mail.
- Open the Messages tab and enter an email address to which reports of undelivered emails will be sent. This way, an administrator can be alerted if the server cannot connect to the main SMTP server and successfully send emails. The other settings can be left as they are:
Note: If FotoWeb workflows are configured to deliver files via email, you might need to increase the maximum message size to allow sufficient space for attachments. (See above screenshot)
- Open the Delivery tab:
- Select Outbound Security and set the authentication mode required by the destination mail server.
In this example, we're relaying emails through another mail server, so the screenshot shows Basic authentication as required by the relaying mail server. The mail server you use may require another type of authentication:
The destination mail server in this example requires the TLS encryption option to be enabled, as shown above.
- Select OK to store the settings, return to the Delivery tab, and select Outbound Connections:
- Set the TCP port according to your primary SMTP server's settings. The default port number is 25, but the screenshot shows this set to 587, which is the correct setting for the destination mail server in this example.
- Select OK to save and return to the Delivery tab, and then select Advanced:
- Set the Smart host to the destination SMTP server's hostname and select OK to store the settings. This is the address to which the SMTP server will forward emails. The destination SMTP server will then take care of actually delivering emails to the intended recipients.
Testing the connection
Using Windows PowerShell you can test if emails are relayed correctly using the syntax below:
Send-MailMessage -SMTPServer localhost -To email@example.com -From firstname.lastname@example.org -Subject "This is a test email" -Body "Hi, this is a test email sent using my own SMTP server as a smart host"
-From parameters with valid email addresses and execute the command with PowerShell to test run the email.
Setting the SMTP service to automatic startup
After configuring the SMTP server, ensure it is set to automatic startup: Open the Windows Services control panel and locate the Simple Mail Transfer Protocol service. Double-click it and set it to Automatic startup. Select OK to save.
Configuring FotoWeb to use the local SMTP server
- From the Tools menu (cogwheel icon), go to Site Configuration > Server Configuration > E-mail Server.
- Enter 127.0.0.1 as the Server name and leave Username and Password empty (since the SMTP server was configured for anonymous access from the localhost above).
- Enter the Sender name, Sender email address, and, optionally, a Reply to address.
For more information about configuring a default email subject, see Configuring email notifications.
Note: If FotoWeb refuses to accept the SMTP server name in the Operations Center, as shown above, it's most likely because IIS6 does not support IPv6. The workaround is to create an entry in the server's HOSTS file (C:\Windows\System32\drivers\etc\) that maps the server name to 127.0.0.1, therefore forcing the name resolution to use an IPv4 address.