I've the certain spreadsheet with the certain data.
I need to email the data from the spreadsheet as attachment in csv/excel format.
Here is code I use
MailApp.sendEmail('
my_e...@example.com', 'Attachment example',
'Two files are attached.',
{
name: 'Automatic Emailer Script',
attachments: [file.getAs('text/csv')]
});
But I got error, that application/pdf can't be converted to 'text/csv'.
How can I solve such task?
Best regards,
Dmitry