animaonline
animaonline

Reputation: 3804

Programmatically publishing an InfoPath form (sending as email)

I'm looking for a way to send an InfoPath form programmatically, equivalent to using the quick publish button in the InfoPath designer, but without using any UI.

I was not able to find a way to do this, I have tried using MailEnvelope , but it brings up an UI and I don't want that.

So I ended up sending the current form file through a SmtpClient, but then the form shows up as a regular attachment.

Does anyone know if there is a possibility to do that from code, or not?

Thanks in advance.

Upvotes: 2

Views: 1898

Answers (1)

ktharsis
ktharsis

Reputation: 3190

You can use SmtpClient with attachments but you have to set the MIME types for the attachments and headers on the email. Instead of copying the full article here, see this link: http://blogs.msdn.com/b/hanuk/archive/2008/03/18/how-to-display-infopath-forms-inline-with-outlook-email-message.aspx

Upvotes: 3

Related Questions