Submitting a form via e-mail...

J

Josh

Is it possible to submit a form via e-mail when you don't use Outlook?
The information I collect using the InfoPath form must be sent by
e-mail, but my entire company uses Lotus Notes, and there is no way
possible to switch.

Thanks in advance!
 
K

Ken K

You may be able to do it using the script method.
Add a Data Connection from the Tools menu to submit data as an e-mail message.
Put a button and a few fields on a test form and give it a try.

function btnSendMail::OnClick(eventObj)
{
//SendMail happens to be the name of the button and the email data
connection
var objEmail = XDocument.DataAdapters("SendMail");
objEmail.To = XDocument.DOM.selectSingleNode("//my:ToField").text;
objEmail.Subject =
XDocument.DOM.selectSingleNode("//my:SubjectField").text;
objEmail.Intro = XDocument.DOM.selectSingleNode("//my:messageField").text;
objEmail.Submit();
}
 
J

Josh

Thanks Ken... however, I am getting an error when I try to plug this
code in.

Error, need object----> var objEmail =
XDocument.DataAdapters("SendMa­il");

Forgive me as I am still wet behind the ears when it comes to
scripting, but where in the example you gave am I able to specify the
form to send the e-mail via lotus notes?

Thanks!
 
K

Ken K

You need to create a Data Connection for an email object.
From InfoPath designer go to Tools > Data Connections...
Click Add.. then "Submit data" > Next
Select "As an e-mail message > Next
Put your address in the To field for now > Next
Enter a name for this data connection: > Finish
(in the code my data connection was called "SendMail" )
The line of script is setting the variable objEmail to the email data
connection.
You put the name of the email data adaptor "SendMail" so it knows which
email adapter you want to use, i.e. there can be more than one.

I have not actually tried this on a machine that doesn't have Outlook
installed on it.
My machine has both Notes an Outlook.
Good Luck
 
J

Josh

Thank you for your help Ken, unfortunately it appears that it is not
working. It is still looking for an object in the line,

objEmail.To = XDocument.DOM.selectSingleNode­


Oh well, I will just have to scrap this idea. Thanks again for your
time!!!

-josh
 

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