Copy link to clipboard
Copied
I have a script that takes an email from a field and uses it for the mailto. It also adds to the subject line.
I want the email from a field to now be the CC and the mailto to be in the actual js code, as well as a subjust line which adds a field as well
var cSubline=this.getField("Cost Centre").value + " Please Prepare Translations for " + this.getField("Month").value + this.getField("Date").value + " At " + this.getField("Time").value;
this.mailDoc
({
cTo:this.getField("Province1").value,
cSubject: cSubline
})
So click the button, the email address is filled out, the CC is from a field, the subject line is a field PLUS some text.
Ideas?
Copy link to clipboard
Copied
The mailto URI in Acrobat is based on the Web URI. The syntax for the "mailto:" statement is no different.
Copy link to clipboard
Copied
The mailto URL uses named parameters for building the email header and body.
https://yoast.com/dev-blog/guide-mailto-links/
The Full mailto Link Syntax list all of the named parameters and has some HTML examples
Copy link to clipboard
Copied
This is for web, I need for PDF?
Copy link to clipboard
Copied
The mailto URI in Acrobat is based on the Web URI. The syntax for the "mailto:" statement is no different.
Copy link to clipboard
Copied
Ok, so I can use this for most of it. thanks. But for the CC, it has to come from a form field the user enters. each form may have a different CC?
Copy link to clipboard
Copied
Check out the following site that can help you generate the mailto JavaScript:
www.fdftoolkit.net/email-pdf-mailto-generator.aspx
Note: Change "NameOfCcField" with the actual name of CC field.
//Place this script in the buttons mouseUp JavaScript event
//http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.pdf#page=345
//SUBMIT PDF FORMAT WITH ADOBE READER
var CC_FIELDNAME = "NameOfCcField";
var url = "mailto:" + encodeURIComponent(this.getField("Province1").value) + "?subject=" + encodeURIComponent(this.getField("Cost Centre").value) + " Please Prepare Translations for " + encodeURIComponent(this.getField("Month").value) + " " + encodeURIComponent(this.getField("Date").value) + " At " + encodeURIComponent(this.getField("Time").value) + "&body=See attached file...&cc=" + encodeURIComponent(this.getField(CC_FIELDNAME).value) + "&bcc=";
var submitAs = "PDF";//PDF,FDF,XFDF,XDP,XML
this.submitForm({cURL:url,cSubmitAs:submitAs});
Copy link to clipboard
Copied
Perfect, thank you.
Copy link to clipboard
Copied
See the maiDoc method in the Acrobat JavaScript API Reference.
Copy link to clipboard
Copied
Hi all, I am trying to solve a similar issue and any help will be appreciated.
I want the mailto to be always the same email address, but the email from a field to be the CC.
Any ideas?
Copy link to clipboard
Copied
Basically,
When the user clicks the submit button, I want the PDF form to be attached in the email. And the mailto address is always the same address, but I need the email address from a field to be the CC.
I pretty sure this is possible but I don't have any idea how.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thank you, try67. That worked perfectly. Appreciate it.