Ben C
Ben C

Reputation: 61

Script to send sheet as email to address in cell

I have this script:

function EmailQuote() { var message = { to: "[email protected]", subject: "Quote", body: "Hi, Please find attached quote", //name: "", attachments: [SpreadsheetApp.getActiveSpreadsheet().getAs(MimeType.PDF).setName("Quote")] } MailApp.sendEmail(message); }

to send an email of the sheet as a pdf.

I would like it to send the email to the address in cell B13 instead of to [email protected].

Can anyone help with how to do this please?

Many Thanks

Upvotes: 0

Views: 53

Answers (1)

Martín
Martín

Reputation: 10084

Change "[email protected]" with SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getRange("B13").getValue()

Upvotes: 1

Related Questions