'Google Script sending mail from workspace account don't work. Mails are not received

I have made a script in Google to send mails from spreadsheet data:

`function sendReport9() { var message = { to: SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Data").getRange("A1").getValue(), subject: SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Data").getRange("A11").getValue(), body: "test", name: "test", } MailApp.sendEmail(message);

}'

The script was working fine in my personal account. But in my Workspace account the mails are rejected. If i run the script, the mail comes in my send box, but is not received. In the admin console i can see the mail is rejected:

Message rejected. See https://support.google.com/mail/answer/69585 for more information.

If i run the same script on my personal account using the same adress to send to, the mail does get received. Also, if i forward the mail that comes in my send box to the same adress, it also get received. And if i use my own workspace mail as adress i also get the mail, but all other adresses (including Gmail) reject the send mail.

I hope someone could help me.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source