Good reasons to configure a local SMTP server
FotoWeb requires an email server for many of its core functions. Because it does not support SSL encypted authentication to SMTP servers, if your email server requires authentication using SSL we recommend setting up an SMTP service on the FotoWeb server that can relay all emails sent by FotoWeb to your primary SMTP server.
Another very good reason for setting up a relay server is that it helps ensure 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 in the event that the main mail server is down for maintenance.
Choice of email service
Any SMTP service that supports relaying can be installed on the server. Below is a thorough walkthrough of how to configure the SMTP service that comes with Internet Information Services (IIS) in Windows.
There is also the option to use for example hMailServer, which is a standalone third party email service that supports relay. Installation and configuration instructions can be found on the hMailServer website.
Adding the IIS SMTP feature to your server
Assuming you want to use the IIS SMTP service, the instructions below explain how to install and configure it for relaying emails.
IMPORTANT: 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 choose Add roles and features.
- Choose Role-based or feature-based installation and click Next. Choose your server in the next window and click Next again.
- Scroll down in the list of roles and choose Web server (IIS) and click Next. Confirm any additional features that need to be enabled.
- Next, select the SMTP Server feature in the list of features. Confirm any additional features that need to be installed.
- Click Next to start configuring the web server role.
- Click Next to proceed with the default web server settings. IIS will now also be installed and configure web services on port 80. If you choose to install FotoWeb using the embedded Apache web server, you can reconfigure the ports in the IIS Manager afterwards so the two web servers don't both use port 80 for http traffic.
- Click on Install to add the roles and features to the server.
Configuring the SMTP server
1. Open IIS Manager 6: Hit Windows-R and enter inetmgr6 and click OK to start it.
Important: 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 the version 6 one to configure the SMTP server.
2. In IIS manager, right-click on SMTP Server and choose Properties:
3. On the General tab, leave the settings as they are so that IP address is set to All unassigned.
4. Next click on the Access tab:
5. Click on Authentication and make sure Anonymous access is checked and click OK:
6. Back on the Access tab, click on the Connection button.
Select Only the list below and click Add. Then add 127.0.0.1 as the IP address and click 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.
7. Click OK to get back to the Access list tab and click on the Relay button. Enter 127.0.0.1 as the IP address here and click 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.
8. Next, go to the Messages tab and enter an email address that reports of undelivered email will be sent to. 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:
Important: If FotoWeb workflows are configured to deliver files via email, it may be necessary to increase the maximum message size to allow sufficient space for attachments. (See above screenshot)
9. Now go to the Delivery tab:
10. Click on Outbound Security and set the authentication mode required by the main SMTP server.
In this example we're using Gmail's SMTP server for relaying emails, so the screenshot shows Basic authentication as required by Gmail. Your SMTP server may require another type of authentication:
When using Gmail, TLS encryption must also be enabled, as shown above.
11. Click OK to store the settings and return to the Delivery tab, and then click on 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 Gmail's SMTP server.
12. Click OK to save and return to the Delivery tab, and then click on the Advanced button:
Now set the Smart host to your main SMTP server's host name and click on OK to store the settings. The example above shows the gmail address, smtp.gmail.com. This is the address the SMTP server will forward emails to. The main SMTP server will then take care of actually delivering emails to the intended recipients.
Testing the connection
Using Windows PowerShell it is possible to test whether emails are relayed correctly, using the syntax below:
Send-MailMessage -SMTPServer localhost -To firstname.lastname@example.org -From email@example.com -Subject "This is a test email" -Body "Hi, this is a test email sent using my own SMTP server as a smart host"
Replace the -To and -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 you should make sure 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. Then click OK to save.
Configuring FotoWeb to use the local SMTP server
Open the FotoWeb site configuration and navigate to Site - Services - E-mail Server.
Enter 127.0.0.1 as the Server name and leave Username and Password fields blank (since the SMTP server was configured for anonymous access from localhost above).
Then fill in Sender name, email address and optionally a reply-to address.
If FotoWeb refuses to accept the SMTP server name when entered 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, thus forcing the name resolution to use an IPv4 address.