Hello to all,
I am desperate for a fix and hoping someone can help me. I have a PDF form that I want submitted via email as a PDF attachment. I need to submit button to email to one email address and cc: to two other addresses based off the information provided on the form.
I have written the JavaScript and it works, but when I extend the features in Adobe Reader it leaves off the second email address. But if you close the email window and press submit again it works. I have changed my email address below for privacy, but otherwise it's exactly the same.
Can someone help please?
Thanks
Laila
Here is the script:
// so that the form is always returned to the same address
// Change address on your form
var cToAddr = "firstname [dot] lastname [at] companyname [dot] 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 = "New Hire Requisition Form";
var cBody = "Thank you for submitting your form, Human Resources will respond within 24 to 48 hours.\n" +
"Please remember to cc: your 2nd level approver in order to approve the position, salary and posting costs.";
// Send the form data as an PDF attachment on an email
this.mailDoc({bUI: true, cTo: cToAddr, cCc: cCCAddr,
cSubject: cSubLine, cMsg: cBody});