I am trying to submit a Web Browser Form to a document library in another web application which has incoming email enabled. So far I have identified two problems with this:
- SharePoint 2010 doesn't allow email messages with the X-Mailer value including "SharePoint" (this value is set by InfoPath/SharePoint) to be imported.
- SharePoint apparently doesn't allow the email message content-type (mime type) "multipart/related" to be imported.
I've tried getting around this with VBScript in the form of smtpreg and an additional "OnArrival" filter that removes the X-Mailer header. However, changing the content type is either really difficult or impossible using the VBScript method.
People talk about sending emails using the FormCode of an InfoPath form, but I am not seeing how to send an email using System.Net.Mail and still include the form data as an attachment, like the normal email submit. My guess is that if I send the attachment using System.Net.Mail I can either set the mime type for the email message manually, or it will default to multipart/mixed instead of multipart/related.
How can I make this happen or is it even possible? I am open to solutions that involve either the VBScript approach or the FormCode/CodeBehind approach for InfoPath.