Specify different SMTP settings for the Send Email Message save action
Specify different SMTP settings for the Send Email Message save action.
The Send Email Message save action sends an email every time a visitor clicks the Submit button on a form. The email is sent using the SMTP protocol, and you can specify different SMTP settings for the save action than those that are set by default.
If your Sitecore solution works in a multiserver environment, you must follow the multiserver environment section.
This topic describes how to:
To specify different SMTP settings for the Send Email Message save action:
In the content tree, navigate to the
Save Actions
folder (sitecore/System/Modules/Web Forms for Marketers/Settings/Actions/Save Actions
), and click the Send Email Message item.In the right pane, in the Submit tab, in the Parameters field, enter the relevant code to specify different values from those defined in the
Sitecore.config
file. For example:<Host>smtp-mail.outlook.com</Host><Port>587</Port><EnableSsl>true</EnableSsl><Login>sitecore@outlook.com</Login><Password>xyz1234<Password><IsBodyHtml>true</IsBodyHtml>
The following list shows the available parameters that you can use with this save action, and their description:
Parameter
Description
<Host></Host>
Mail server host name
<Port></Port>
Mail server port number
<EnableSsl></EnableSsl>
Use SSL
<Login></Login>
Login to access the mail server
<Password></Password>
Password to access the mail server
<IsBodyHtml></IsBodyHtml>
Email body is in HTML format
<IsIncludeAttachments></IsIncludeAttachments>
Email contains attachments
If you want to specify credentials for the SMTP server, in the right pane, in the Parameters field, enter the following text and ensure you specify the relevant login and password credentials. For example:
<Login>mylogin123</Login><Password>mypassword123</Password>
Click Save to save your changes.
Note
To configure the SMTP settings on an item, in the IIS Manager, ensure that you clear the SMTP email settings.
If your Sitecore solution works in a multiserver environment with several Content Delivery (CD) instances, and the Send Email Message save action is configured to run on a CD instance, and each of the CD instances should use its own SMTP settings, you must perform the following steps:
On a Content Delivery (CD) instance
On the Content Delivery (CD) instance, in a text editor, open the
Sitecore.config
file.Configure the following SMTP settings: MailServer, MailServerUserName, MailServerPassword.
On a Content Management (CM) instance
In the content tree, navigate to the
Save Actions
folder (sitecore/System/Modules/Web Forms for Marketers/Settings/Actions/Save Actions
) and click the Send Email Message item.In the right pane, in the Submit tab, in the Parameters field, delete the
<Host></Host>
,<Login></Login>
and<Password><Password>
parameters, if you have any.Click Save, and republish your website.