I developed a IS procurement form. I wrote code for the submit button so that it opens the "Send Form As Attachment" window. (The reason I want to send the email this way is because I want the form to be in HTML format in the body of the email.) However, I would like to be more automated so when the user clicks Submit, it automatically sends. If that's not possible, can there be an alert asking the user to confirm the submit and then that will send the email and close the form?
var mail = XDocument.View.Window.MailEnvelope;
var region = XDocument.DOM.selectSingleNode("/my:myFields/my:userInfo/my:region").text;
var firstName = XDocument.DOM.selectSingleNode("/my:myFields/my:userInfo/my:firstName").text;
var lastName = XDocument.DOM.selectSingleNode("/my:myFields/my:userInfo/my:lastName").text;
var department = XDocument.DOM.selectSingleNode("/my:myFields/my:userInfo/my:department").text;
if (region =="Corporate")
{
mail.To = "[email protected]";
mail.CC = "[email protected]";
var subject = "Request from " + firstName + " " + lastName + " of " + department + " department in " + region + " region.";
mail.Subject =subject;
}