1

I want to send an email with bcc option. Email works fine but I cannot use bcc.

How can I send a bcc with the info given from a range or cell value?

See my code below

GmailApp.sendEmail(emailAddress, subject, message, {
        bcc: 'xxxxxxxx@gmail.com',
       // attachments: [blobs[i]], kmlijst
       attachments: [blobs[i], kmlijst.next()]
      });

bcc: 'xxxxxxxx@gmail.com' has to be a cell vallue from

      var emailRange2 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Lees_deze_informatie").getRange("d3");
var emailAddress2 = emailRange.getValues();
1

1 Answer 1

0

You are extracting the value from a single cell (D3), so you would use getValue().

DELETE: var emailAddress2 = emailRange.getValues();

SUBSTITUTE: var emailAddress2 = emailRange.getValue();

2
  • Thank you i saw more problems like the var did not match emailrange had to be emailrange2
    – john doe
    Aug 31 at 16:05
  • Indeed - one of the drawbacks with looking at "snippets" versus whole functions. Having said that, if this answer was useful, then you might consider accepting it
    – Tedinoz
    Sep 1 at 1:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.