Error submitting form when using Send Email action in WFFM


Description

When using the Send Mail save action in Web Forms for Marketers module, the form may not be saved after being submitted by site visitors and the following exception may appear in the log file:

Exception: System.FormatException Message: The specified string is not in the form required for an e-mail address. Source: System    at System.Net.Mail.MailAddressParser.ReadCfwsAndThrowIfIncomplete(String data, Int32 index)    at System.Net.Mail.MailAddressParser.ParseDomain(String data, Int32& index)    at System.Net.Mail.MailAddressParser.ParseAddress(String data, Boolean expectMultipleAddresses, Int32& index)    at System.Net.Mail.MailAddressParser.ParseMultipleAddresses(String data)    at System.Net.Mail.MailAddressCollection.ParseValue(String addresses)    at System.Net.Mail.MailAddressCollection.Add(String addresses)    at System.Net.Mail.Message..ctor(String from, String to)    at System.Net.Mail.MailMessage..ctor(String from, String to)    at Sitecore.Form.Core.Pipelines.ProcessMessage.ProcessMessage.GetMail(ProcessMessageArgs args)    at Sitecore.Form.Core.Pipelines.ProcessMessage.ProcessMessage.SendEmail(ProcessMessageArgs args)    at (Object , Object[] )    at Sitecore.Pipelines.PipelineMethod.Invoke(Object[] parameters)    at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)    at Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)    at Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args, String pipelineDomain)    at Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args)    at Sitecore.Form.Submit.SendMessage.ExecuteMail(ID form, AdaptedResultList fields)    at Sitecore.Form.Submit.SendMail.Execute(ID formid, AdaptedResultList fields, Object[] data)    at Sitecore.Form.Core.Submit.SubmitActionManager.ExecuteSaving(ID formID, ControlResult[] list, ActionDefinition[] actions, Boolean simpleAdapt, ID sessionID)

This behavior would happen when "To", "From", or "CC" fields of save action contain double brackets in their value as a result of using the Send Mail Editor dialog.

This issue affects WFFM 2.3 rev. 110530 - 2.4 rev. 150619.

Solution

To resolve the described issue, apply the following patch:

  1. Download an archive that corresponds to your WFFM module version:
  2. Extract the files.
  3. Put the Sitecore.Support.402562.dll file into the \bin folder.
  4. Put the SendEmail.xml file into the \sitecore\shell\Override folder.
  5. Reassign the value of a particular field using the Send Mail Editor dialog.
  6. Publish the changes.