Programmatically Automating "Send to Mail Recipient" Feature

I

Ian Russell

Hello,

I am relatively new to InfoPath and am looking for a little guidance with a
problem of mine.

I've created a fairly basic InfoPath SP1 form that pulls data from a
secondary data source (SharePoint list). At the moment, I haven't used any
code... yet.

I've configured the form to submit via two rules. One submits to a
SharePoint form library and the other via e-mail (Outlook 2003/Exchange 2003
environment).

The problem is that some of the recipients of the e-mail message will not be
using InfoPath. As a workaround, I can use the "Send to mail recipient"
from the "File" menu which works great as the e-mail message contains the
embedded form as HTML however I am looking to programmatically automate
this.

I cannot find any documentation or examples on programmatically using the
"Send to Mail Recipient" feature so it puts the form into the message body
as HTML and allows me to specify To/Cc/Subject.

Any help is appreciated.

Thank you,

Ian
 
A

Andrew Watt [MVP - InfoPath]

Hello,

I am relatively new to InfoPath and am looking for a little guidance with a
problem of mine.

I've created a fairly basic InfoPath SP1 form that pulls data from a
secondary data source (SharePoint list). At the moment, I haven't used any
code... yet.

I've configured the form to submit via two rules. One submits to a
SharePoint form library and the other via e-mail (Outlook 2003/Exchange 2003
environment).

The problem is that some of the recipients of the e-mail message will not be
using InfoPath. As a workaround, I can use the "Send to mail recipient"
from the "File" menu which works great as the e-mail message contains the
embedded form as HTML however I am looking to programmatically automate
this.

I cannot find any documentation or examples on programmatically using the
"Send to Mail Recipient" feature so it puts the form into the message body
as HTML and allows me to specify To/Cc/Subject.

Any help is appreciated.

Thank you,

Ian

Have you looked at the information in the Help files on the
EmailAdapter object?

Andrew Watt
MVP - InfoPath
 
I

Ian Russell

Thanks Andrew. I had looked into the EmailAdapter object but it looks like
it mimics the functionality of the "submit" data connection to e-mail and
only attaches the .xml file, and does not include the actual form/contents
in the message body.

With a little bit of dumb luck I happened across the following archived
infopath blog:

http://blogs.msdn.com/infopath/archive/2004/08/17/216172.aspx

After adapting "XDocument.View.Window.MailEnvelope" into my code, I am now
able to programmatically have it show the e-mail toolbar and populate the
fields I want (To/Cc/Subject) by calling fields via the DOM. i.e mail.To =
XDocument.DOM.selectSingleNode("myfieldreference"), etc... AND have it
contain the form as HTML within the e-mail message body.

Lots more to figure out but thought I'd post what I found so far...

Cheers,

- Ian
 
P

pspl_Ravindra

Hi, We have also tried to use the MailEnvelope to send mail
programatically. The problem is that it pops up a dialog box which
showns the email composed and we have to click on the send button, to
send the email. It requires a manual intervention.

We do want to achieve the 'Submit' button click functionality in the
code. Please let us know how to achieve this....

Thanks in advance.

Ravindra.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top