Skip to main content
Rstreet
Inspiring
August 9, 2019
Question

Emailing a File

  • August 9, 2019
  • 1 reply
  • 311 views

Greetings - I am in hopes that someone might be able to assist in helping me Save a file, with a new name, to a temp folder (?), and then possibly attach the newly renamed file to an email.

I already have some code (found here - thanks Thom Parker!) that works as should. Now what I am looking to do, is rename the file and email the renamed file.

Here is my email code:

{

// To email adresss

//var cToAddr = "email@email.com";

var cToAddr = "email@email.com";

// BCC email address

var cBCCAddr = "email@email.com";

// Set the subject for the email message

var cSubLine = "Donation Acceptance - " + this.getField("Name").value + " - " + this.getField("Today").value + "";

// Set the body text for the email message

var cBody = "Attached is a new Donation Acceptance Acknowledgement from " + this.getField("Name").value + " " + "for your review.\n\n" + "Thank you." + "\n\n"

// Send the entire PDF as a file attachment on an email

this.mailDoc({bUI: true, cTo: cToAddr, cBcc: cBCCAddr, cSubject: cSubLine, cMsg: cBody});

Anyone know how to Save the file with a new file name, and attach the renamed file to the message; rather than the current opened file?

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
August 9, 2019

Read this tutorial: https://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript

In short, in order to be able to do it you must run the code from a js file that's installed on the local machine, or certify your file first.

Also, it can't create folders, only use existing ones.