Skip to main content
Inspiring
December 13, 2023
Answered

How do I add C and Bcc with multiple emails when submitting a form with JavaScript?

  • December 13, 2023
  • 1 reply
  • 1142 views

I have a form that I am using a javascript to email the whole form to a targetEmail, however, I want to include a Cc and Bcc to multiple email addresses. I would also like to include a secondary text field in the subject line. I've tried different variations to no avail, I'm stuck and not sure what to do. Any and all help is greatly appreciated. The code I'm using is below.

 

var targetEmail = "mail@titan.com";

var subjectLine = this.getField("Requested BY").valueAsString;

var body = "Tango Tank Request\nOrdered By: " + this.getField("Requested BY").valueAsString + " " + "\n" + this.getField("Notes and Comments").valueAsString

this.mailDoc({cTo: targetEmail, cSubject: subjectLine, cMsg: body});

This topic has been closed for replies.
Correct answer try67

It's all documented in the reference for this method...

 

this.mailDoc({cTo: targetEmail, cSubject: subjectLine, cMsg: body, cCc: "john.doe@gmail", cBcc: "jane.doe@aol.com;me@yahoo.com"});

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
December 13, 2023

It's all documented in the reference for this method...

 

this.mailDoc({cTo: targetEmail, cSubject: subjectLine, cMsg: body, cCc: "john.doe@gmail", cBcc: "jane.doe@aol.com;me@yahoo.com"});

glazed01Author
Inspiring
December 14, 2023

Thank you @try67, You've been a huge help and I do appreciate all of your help!