Submitting a form via Email - InfoPath Dev
in

InfoPath Dev

Submitting a form via Email

Last post 12-27-2006 05:25 AM by madhuri. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-26-2006 06:00 PM

    Submitting a form via Email

    I would like to submit a form via email using Infopath 2003. I created the Data Connection, changed the Button properties Label: Submit email and changed ID: btnSendMail, then edited form code to read the following (I enter the code in the brackets):
    var objEmail = XDocument.DataAdapters ("Submit");
    objEmail = XDocument.DOM.selectSingleNode ("//my:ToField").text;
    objEmail = XDocument.DOM.selectSingleNode ("//my:SubjectField").text;
    objEmail.Submit();

    I save the changes to the script.

    When I click on the my new submit button I receive a script error on this line of code: objEmail = XDocument.DOM.selectSingleNode ("//my:ToField").text;

    Does anyone have any suggestions to correct my script error to assist me in creating a script that will allow me to submit a form via email.

    Thanks
    Heidi
  • 12-27-2006 05:04 AM In reply to

    Re: Submitting a form via Email

    Hi,
    Check out the following link
    http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=1813

    Hope this helps you!
    Shilpa
    INFOPATHDEV India
  • 12-27-2006 05:25 AM In reply to

    Re: Submitting a form via Email

    Hi

    Your are using email dataconnection using data adapter.Data adapter is an object and 'To' is the property of this object which we need to add in the code

    You have wrtten this code line as
    objEmail = XDocument.DOM.selectSingleNode ("//my:ToField").text;

    in the above code line should be written as
    objEmail.To = XDocument.DOM.selectSingleNode ("//my:ToField").text;

    similarly for subject
    objEmail.Subject = XDocument.DOM.selectSingleNode ("//my:SubjectField").text;

    Look at the following link
    http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=2583
    Madhuri
    http://www.ggktech.com
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.