i have a form that submits in two ways, firstly the form is send to a section head for him/her to approve/reject the application and then the section head is to click the button to submit the form details to the database. i decided to use the submit to database button at the end and then programmatic attach code to another button that will send the email to the section head. below is the code that i am using to send the form as attachment to the section head. the error i get is that the VarTo is not defined, what should i do
i fristly tired the email adapter method and then the mail envelope but i get the same error from both methods - PLEASE HELP!!!!
function SubmitEmail::OnClick(eventObj)
{ // Write your code here- 01/07/2008 (MB)
//var objEmailAdapter;
var mail = XDocument.View.Window.MailEnvelope;
var varTo = XDocument.DOM.selectSingleNode("/my:myFields/my:EmailInfo/my:");
var varCC = XDocument.DOM.selectSingleNode("/my:myFields/my:EmailInfo/my:CC");
var varBCC = XDocument.DOM.selectSingleNode("/my:myFields/my:EmailInfo/my:BCC");
var varIntro = XDocument.DOM.selectSingleNode("/my:myFields/my:EmailInfo/my:Intro");
var varSubject = XDocument.DOM.selectSingleNode("/my:myFields/my:EmailInfo/my:Subject");
//objEmailAdapter = XDocument.DataAdapters("EmailSubmitAdapter");
mail.To = VarTo.text;
mail.CC = VarCC.text;
mail.BCC = VarBCC.text;
mail.Intro = VarIntro.text;
mail.Subject = VarSubject.text;
//objEmailAdapter.Submit();
mail.Visible = true;
}