InstallationInstall Sana Commerce Webshop on Web and Database Server

Install Sana Commerce Webshop on Web and Database Server

Configure the Mail Settings

Step 1: Open the web.config of the Sana Commerce Starter Site project in Visual Studio or any text editor
(do the same for the 'web.config' file of the 'Sana.Commerce.BackOffice' project).

Step 2: Locate the sites section in the 'sanaCommerce' configuration section:

<sites defaultsite="Demoshop" contentProvider="SanaSqlContentProvider" SendMailToReportAddress="false" ReportAddress="YourEmail">
<site code="Demoshop" shopType="B2X">
        ... 
</sites>
  
The ReportAddress value "YourEmail" must be changed to valid e-mail.

In the sites node, there is an attribute 'SendMailToReportAddress' that indicates if all e-mails sent by Sana Commerce (e.g. order confirmation e-mail) should be sent to a report address instead of the original targeted e-mail address. This can be useful in the development environment to make sure real customers do not receive test e-mails. When this option is set to true, enter the report e-mail address(es) in the 'ReportAddress' attribute of the sites node. Multiple e-mail addresses can be separated with the ';' symbol. Please note that the 'ReportAddress' attribute is the required field even if the option is not used!

Step 3: Locate the 'mailSettings' configuration section under the 'system.net' node in the 'web.config' file of the Sana Commerce Starter Site project:

<system.net>
   <mailSettings>
       < smtp >
           <network host="YourSmtpServer" port="25" />
       </smtp>
   </mailSettings>
   <connectionManagement>
           <add address="*" maxconnection="100"/>
   </connectionManagement>
</system.net>

Step 4: Change the host attribute in the network node to the e-mail server you are using. Also change the port number of this e-mail server when necessary.

You can configure 'from' e-mail address and address(-es) of recipients for contact form on website configuration page in backoffice. For more info please read this chapter.
     
In a production environment, we recommend to configure the local SMTP server of IIS as the mail server (127.0.0.1). This SMTP server can then be relayed to the 'real' mail server. When using this setup, no e-mails will be lost when the mail server is (temporary) unavailable. Instead the e-mails are stored in the queue of the local SMTP server and picked up by the mail server when it is back online.
 
You can find how to configure an SMTP Server in IIS 7 here.