Recently I have decided to upgrade to a GSuite account from the basic free gmail account. I have a collection of Google AppsScripts that manage a collection of forms/spreadsheets and send out notifications on changes. All scripts were copied into the new GSuite account and all seem to run well. All APIs used (spreadsheet, calendar, drive, forms work with the except of the script.send_mail which refuses to send any emails to external email addresses. If I set it to send emails to myself, it works fine, but to any external email and the message gets blocked with this message
Action: failed
Status: 5.0.0
Diagnostic-Code: smtp; Message rejected. See https://support.google.com/mail/answer/69585 for more information.
Last-Attempt-Date: Mon, 30 Sep 2019 14:02:02 -0700 (PDT)
I have created a very simple script to test it and it still fails. Code attached:
function testSendMsg(){
var subject = "Test Message";
var message = " Testing 1 2 3..";
var emailAddr = "emailaddressX@gmail.com"; // put correct email address here
MailApp.sendEmail(emailAddr,subject,message);
}
Sending this email using the browser mail app works fine, only the script based email sends fail. Any help or pointers on this is appreciated.
Google Cloud Support was not able to find any solutions to this!