google api to send email via custom function
Hello,
I'm having lots of trouble sending emails via custom functions and sendmail. There appear to be weird restrictions on who can send/receive i.e. the admin or logged in user must be in either the from or to field !!!
As an alternative, is it possible to use the google gmail api to send emails directly from gmail but instigated in a custom function?
POST https://www.googleapis.com/upload/gmail/v1/users/userId/drafts/send
I can see that it's possible to make a connection to the gmail api via developer space -> connections.
Does anyone have any working "deluge" code showing how to send an email in this way please?
Regards,
Simon