Scopes ....../auth/gmail.send versus ......./auth/script.send_mail

16 views
Skip to first unread message

Alan Wells

unread,
Sep 29, 2019, 9:24:58 PM9/29/19
to google-apps-sc...@googlegroups.com

gmail.send -
Wording in authorization dialog: Send email as you
Information in authorization dialog: Send email that appears to have been sent by you (e.g., from your email address)
Usage: Sensitive
Used for: GmailApp and GMail API

script.send_mail
Wording in authorization dialog: Send email on your behalf
Information in authorization dialog:Send email that appears to have been sent by you (i.e., from your email address)
Usage: Sensitive
Used for: MailApp

My concern is, that MailApp.sendEmail() and GmailApp.sendEmail() may not behave exactly the same in all situations.  I'm worried that MailApp.sendEmail() might not work in some situations, like certain domain account types.  I don't have any proof of this, but a long time ago, people were encouraged to switch from GmailApp to MailApp because of something about GSuite permissions, or something like that.  I don't want to ask for two scopes that are basically identical, but I'm concerned that under some situation, MailApp could fail.  I recently saw another add-on that was using both scopes.  Why would someone use two scopes that are asking for the exact same permission?  I changed everything from GmailApp.sendEmail() to MailApp.sendEmail(), but now I'm wondering whether that was the best choice.  It seems like I'd be better off with:
GmailApp.sendEmail()
and scope:
/auth/gmail.send



Mail scopes.PNG


Reply all
Reply to author
Forward
0 new messages