Thursday, January 12, 2023

GMailApp sendEmail - "from" needs to be an alias

Just a quick note - GMailApp SendEmail options do have a "from" address which we can choose, but the "from" needs to be an alias of the account from which the email is being sent. "replyTo" does not have that limitation, so we can use that instead. 

https://developers.google.com/apps-script/reference/gmail/gmail-app#sendemailrecipient,-subject,-body,-options

https://developers.google.com/apps-script/reference/gmail/gmail-app

 

GmailApp.sendEmail(recipientsubject"", {
            replyTosemail,
            namerequestorname,
            htmlBodyemailbody
        })

 

https://developers.google.com/apps-script/reference/gmail/gmail-app#sendemailrecipient,-subject,-body,-options

 

https://developers.google.com/apps-script/reference/gmail/gmail-app#advanced-parameters_1

https://developers.google.com/apps-script/reference/gmail/gmail-app#advanced-parameters_1

No comments:

Post a Comment