// This is the form return e-mail. Its hardcoded
// so that the form is always returned to the same address
// Change address on your form
var cToAddr = "formsAdmin@BigCorp.com";
// First, get the client CC e-mail address
var cCCAddr = this.getField("ClientEmail").value;
// Now get the beneficiary e-mail only if it is filled out
var cBenAddr = this.getField("BennyEmail").value;
if(cBenAddr != "") cCCAddr += ";" + cBenAddr;
// Set the subject and body text for the e-mail message
var cSubLine = "Form X-1 returned from client"; var cBody = "Thank you for submitting your form.\n" + "Save the mail attachment for your own records";
//** Send the form data as an XML attachment on an e-mail
// Build the e-mail URL
var cEmailURL = "mailto:rolodexp@aol.com" + cCCAddr + "&subject=" + cSubLine + "&body=" + cBody;
this.submitForm({
cURL: cEmailURL,
cSubmitAs:"XML",
cCharSet:"utf-8"
});