Correctly Use createDraft Option

108 views
Skip to first unread message

fernando....@dish.com

unread,
Aug 25, 2022, 5:51:48 PM8/25/22
to Google Apps Script Community
Hello -

I am struggling to find the correct usage for the createDraft method advanced parameters, specifically the advanced parameter cc. The documentation states cc is "a comma-separated list of email addresses," but provides no formatting example in the documentation for this parameter. Can a helpful member please post an example on the correct formatting?  

CBMServices Web

unread,
Aug 25, 2022, 6:11:00 PM8/25/22
to google-apps-sc...@googlegroups.com
Hi the cc field is similar to the to field. The list of emails is a comma separated string and it needs to look like this:


You can string as many email addresses as you want, just be careful of you addressee cap limits..



On Thu., Aug. 25, 2022, 2:51 p.m. fernando....@dish.com, <fernando....@dish.com> wrote:
Hello -

I am struggling to find the correct usage for the createDraft method advanced parameters, specifically the advanced parameter cc. The documentation states cc is "a comma-separated list of email addresses," but provides no formatting example in the documentation for this parameter. Can a helpful member please post an example on the correct formatting?  

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/c661cbb7-88c7-4d5c-b7ad-a06a1200e191n%40googlegroups.com.

Edward Ulle

unread,
Aug 25, 2022, 6:14:25 PM8/25/22
to Google Apps Script Community
I tried this and it works

    GmailApp.createDraft("reci...@gmail.com","CC Example","This is the body of the email",

fernando....@dish.com

unread,
Aug 25, 2022, 6:52:58 PM8/25/22
to Google Apps Script Community
Thanks for that. I was formatting it as an array: ["emailUser@gmail", "emaiUser2@gmail"]. Is it not possible to set up an array with email addresses, then call that array? I am able to do just that for the main recipients. I find it odd that an array cannot be plugged in to cc: option.
Reply all
Reply to author
Forward
0 new messages