Reputation: 23
Having some trouble with the Web Forms for Marketers Module (2.3.0 rev.120216) for Sitecore (6.5.0 rev.120472).
I've set up a form with a 'Sent email' action. When the form doesn't have a 'file upload' field, the form sends fine. When it does contain a 'file upload' field, the email wont send and I get a error in the log file:
Parameter name: stream
Exception: System.ArgumentNullException
Message: Value cannot be null.
Parameter name: stream
Source: System
at System.Net.Mime.MimePart.SetContent(Stream stream, String name, String mimeType)
at System.Net.Mail.AttachmentBase..ctor(Stream contentStream, String name, String mediaType)
at System.Net.Mail.Attachment..ctor(Stream contentStream, String name, String mediaType)
at Sitecore.Form.Core.Pipelines.ProcessMessage.ProcessMessage.AddAttachments(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)
Was wondering if anyone had encountered this/knows a solution?
Thanks in advance!
UPDATE: Have discovered that providing the 'file upload' field is not a required field, when leaving it empty and submitting the form, the email will still send. It will only fail to send when the 'file upload' field is utilised by a user.
Upvotes: 1
Views: 1622
Reputation: 1126
My first question is to ask what is it that you're trying to send? The first thing to understand is that there are 2 different ways of "sending email" on form submission. One is the standard sort of out of the box task that comes with Sitecore. The other is a much more robust email that uses the Email Campaign Manager module. It makes a huge difference since those 2 sending tasks have very different ways in which they handle building the email and there's obviously something going wrong, but it's impossible to say without more info. I'd have to see more about how you have configured your send action and some of the log files to understand for sure.
If it were up to me, though, I'd also go create a standard message via the ECM module (if you have it) and use that instead. As I said, it's much more robust and can be used to do the exact same thing with some additional bells and whistles if you wanted them.
Upvotes: 0