Is this really the version you are looking for? Kentico Xperience 12 Service Pack Documentation is no longer updated. Use the switcher in the header to choose your product version.
Kentico includes many features that utilize email messages as part of their functionality, such as:
To allow the application to send out emails, you need to register and configure at least one SMTP server in the administration interface.
To register the main SMTP server:
Open the Settings application.
Navigate to the System → Emails category.
Select an option in the Site selector:
Fill in the following settings:
SMTP server – enter the domain name or IP address of the server. Enter localhost to use the server provided by your local machine. The connection automatically uses the HTTPS protocol if supported by the specified server.
SMTP server port
By default, the connection to the SMTP server uses port 25. To use a different port, include it in the server name. For example: 127.0.0.1:587
SMTP server user – enter the username used for authentication when connecting to the SMTP server.
Authentication type – select the authentication mode used to connect to the SMTP server:
SMTP server password – if you have Basic selected as the Authentication type, enter the password required to connect to the SMTP server under the specified username. Leave empty when using OAuth 2.0.
Info: After you enter and save a password, the field always displays 8 "masking" characters, even if the password is longer or shorter. This measure helps protect your password.
OAuth credentials – if you have OAuth 2.0 selected as the Authentication type, select the OAuth credentials used for authentication. You can create and manage the credentials in the Email OAuth credentials application.
Click Save.
The system uses the primary server as the default option when sending emails.
Kentico EMS required
You need the Kentico EMS license to register multiple SMTP servers.
In addition to the default server, you can add any number of servers in the SMTP servers application. Having multiple SMTP servers allows the system to send out a greater volume of email traffic. Emails use the extra servers whenever the default server is busy.
You can manage existing servers through the following actions:
To register new servers, click New SMTP server.
When creating new SMTP servers or editing existing ones on the General tab, you can fill in the same options as described for the default server. In addition, you can choose the delivery method for emails:
Microsoft Azure supports only the Network method.
You may also select the server's Priority. See the Configuring email processing section below for more information about server priority.
If there are multiple sites running under your application, you can assign servers to individual websites on the Sites tab. SMTP servers can either be global or limited to one or more specific websites.
You can configure how the system delivers emails to the SMTP servers through the settings in Settings -> System -> Emails.
Enabling sending of emails
We recommend keeping the Enable emails setting enabled both globally and for all sites (switch between the options using the Site selector in the Settings application).
Having the setting enabled globally is required for the system to send emails that are not related to a specific site (for example emails sent by marketing automation processes, etc.).
If Enable email queue is selected, the system temporarily stores all outgoing emails in the database instead of sending them directly to the SMTP servers. This allows advanced email processing and resending of mails that are lost due to errors. Using the email queue is highly recommended when sending out large amounts of emails over a short amount of time. Refer to Sending emails to learn more about the email queue.
The system periodically processes the email queue (every minute by default) and asynchronously distributes the stored emails to the SMTP servers:
A predefined amount of emails is loaded from the queue as a batch.
The system goes through the emails one by one and assigns them to servers according to their priority and availability.
When a server receives an email, the server is flagged as busy until the sending is complete.
The system loads a new batch from the queue and continues assigning individual emails to available servers.
This process is repeated until all emails in the queue are mailed out.
The maximum number of emails which is loaded from the database in a single batch is determined by the value of the Batch size setting. The batch size affects all sites in the system, so it is only available if the (global) option is selected in the Site selector on the top left of the settings page.
The value of the batch size affects the number and frequency of database queries. If you set the batch size too large, the system will have to process a lot of database data at one time. Using a smaller batch size increases the frequency of database queries and may reduce the database performance.
To confirm that your SMTP servers are configured correctly and available, you can send testing emails in the System application on the Email tab.
Debugging can help resolve problems with emails sent by Kentico.
To enable email debugging, add the following keys to the configuration/appSettings section of your project's web.config file:
<add key="CMSLogEmails" value="true"/>
<add key="CMSDebugEmails" value="true"/>CMSLogEmails – logs all sent emails to the ~/App_Data/logemails.log file. The log contains each email's:
CMSDebugEmails – disables sending of emails to the actual recipients. The system only logs emails into the event log. Helpful if you need to test the functionality, but do not want the emails to actually reach the recipients.