Reputation: 308
Goal: I have a fillable PDF form that collects data required to send an email. In the PDF, I have a button to send the PDF, using the mailDoc function on mouse up.
if(app.viewerVersion < 11 )
app.alert("Please download the latest version of Reader",1);
var cToAddr = "[email protected]";
var cBCCAddr = "[email protected]";
var cCCAddr = this.getField("ClientEmail").value;
var cBenAddr = this.getField("BennyEmail").value;
if(cBenAddr != "") {
cCCAddr += ";" + cBenAddr;
}
var cSubLine = "Service Proposal " + this.getField("ServiceAddress").value + " " + this.getField("Text1").value;
var cBody = "Thank you for the opportunity. Please see attached proposal.\n" + "Save the filled form attachment for your own records";
this.mailDoc({
bUI: true,
cTo: cToAddr,
cCc: cCCAddr,
cBcc: cBCCAddr,
cSubject: cSubLine,
cMsg: cBody
});
Error Message:
GeneralError: Operation failed.
Doc.mailDoc:22:AcroForm:Email Quote:Annot1:MouseUp:Action1
I've followed this guide and added a cBcc as they did in this community post, but it had no impact.
The fields are accurately named, and it prompts me to sign into my email account when I press the button, so I'm not sure what is causing the issue, and can't find documentation for mailDoc to help.
Upvotes: 0
Views: 2377
Reputation: 2463
Your code is correct. This seems to be a bug when using Yahoo! to send the email. When I try to send it via Outlook or Gmail it works for me (and fails on Yahoo!).
You can find the javascript documentation here: http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.pdf#G5.2237013
Upvotes: 1