I've just been working with WFFM a bit - migrating forms from Sitecore 6.5 - and had to also set it up to use TLS for the mail server.
This post is basically just a cheat sheet of the email options that can be configured and where you can configure them.
The official documentation explains the basics like mail server and credentials etc. but it's missing a few bits.
The 'Send Email Message' save action parameters
On the item
/sitecore/system/Modules/Web Forms for Marketers/Settings/Actions/Save Actions/Send Email Message in the Parameters field you can specify values (as XML) for the following settings:
<Host>smtp.domain.com</Host> <Port>587</Port> <Login>[email protected]</Login> <Password>b</Password> <From>[email protected]</From> <EnableSsl>true</EnableSsl> <IsBodyHtml>true</IsBodyHtml> <IsIncludeAttachments>false</IsIncludeAttachments> <!-- Not mentioned in official docs but should work as well --> <Subject>Default subject</Subject> <Mail>Default email body</Mail> <CC>[email protected]</CC> <BCC>[email protected]</BCC> <LocalFrom></LocalFrom> <RecipientGateway></RecipientGateway> <FromPhone></FromPhone>
Settings from config files
It's only a subset of these settings that can be specified in config files. Values specified on the save action item itself will override any values from config files. Settings like EnableSsl, IsBodyHtml and IsIncludeAttachments can sadly only be specified on the save action although it should be somewhat trivial to change this, potentially by hooking into the
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/"> <sitecore> <settings> <setting name="MailServer" set:value="smtp.domain.com" /> <setting name="MailServerPort " set:value="587" /> <setting name="MailServerUserName" set:value="[email protected]" /> <setting name="MailServerPassword" set:value="b" /> <!-- Corresponds to <From> - default sender address --> <setting name="Analytics.EMailFromAddress" set:value="[email protected]" /> </settings> </sitecore> </configuration>
Note when upgrading from Sitecore 6.5
Most of the forms created with the earlier version of WFFM had
<From> parameters with the default values specified on the form itself in the Save Actions field. These were overriding anything specified in either config files or on the save action item. To fix this we had to manually edit the XML of the Save Actions field on all the forms.
The old forms also had a reference to the old Save to database save action (that no longer exists after 8.0) which we also had to remove.
I created this
.aspx page/script to do this for us - use at your own risk!