Skip to main content
Known Participant
September 18, 2023
Question

Javascript to build an e-mail with attachments

  • September 18, 2023
  • 0 replies
  • 252 views

I have the following Javascript code: 

this.mailDoc({

cTo: "emailaddress@gmail.com",
cSubject: "Royal con formage",
cMsg: "blablablabla"
});

 

which, applied to a certain button, gives me the opportunity to send a pre-set e-mail. Now, I'd like to improve the code by giving the instruction to pre-attach pdf files from my Drive's folders into the e-mail. My job involves crazy amounts of work, so whenever I can spare even seconds of time, it's a great victory. 

I tried to obtain this result by adding the following string: myEmail.attachDoc(filePath);

But due to what happen to be security conditions, I can't execute the code.

 

I don't believe this to be impossible.

In the past I couldn't copy the values from the text fields of a document and past them into the text fields of another separated document, but I managed to create a Javascript to do it in spite of the previous restrictions and problems.

 

Any help will be greatly appreciated

This topic has been closed for replies.