Reputation: 1153
I have a survey form that people submit the hours they work and it sends their response in an email to me and then CC's two other people. The script was authorized by me to send the emails and has worked fine for a long time until a couple days ago when now I am getting a reply back from all three emails saying Message blocked. Any idea why these are being blocked?
MailApp.sendEmail("[email protected]",emailSubject,"", {htmlBody: body, cc: "[email protected], [email protected]"});
If I only send the email to myself then it works perfectly fine. If I include even one CC email address I get the block.
Reporting-MTA: dns; googlemail.com
Arrival-Date: Mon, 12 Nov 2018 04:57:05 -0800 (PST)
X-Original-Message-ID: <[email protected]>
Final-Recipient: rfc822; [email protected]
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, 12 Nov 2018 04:57:05 -0800 (PST)
Upvotes: 3
Views: 3169
Reputation: 21
I do not have a clear answer in here; I just want to be able to converse with devs in the same tough spot between a Google algo and a client having his business interrupted.
@amit: First that link you sent does not cover the actual situation. Second I ran my code for a second time manually and it processed everything perfectly so the content is not the sole trigger for this rejection.
To elaborate: I made a survey tool for a client (with google biz account) that inputs the results in a google sheet with multiple tabs that receive rows of data. Once a day each tab generates a "day summary" of those results and sends it in an email.
It has 1 TO and 2 BCC targets. The body of the text contains multiple email addresses as clickable links. This worked fine till a few weeks ago.
Now today, without changing anything, the emails were sent out with no bounce/rejections. My conclusion is that it is indeed Google's preventive anti-spam filters doing. Just not as simple as "containing links".
Perhaps it's the time? As I see your email, and mine are sent at 3/4 AM, correct? Perhaps it has to do with the CC/BCC emails never being opened? As my BCC targets are both my client's own email addresses (in gmail).
It really sucks that there is no actionable info from Google on this error.
Upvotes: 2
Reputation: 129
Using GmailApp.sendEmail(emailAddress, subject, message)
solves this.
This seems to be an issue with all new GSuite accounts as discussed here: MailApp.sendEmail() in Google Apps Script not sending email
It is particularly frustrating that Google has no response to this huge shortcoming for over 4 months!
Upvotes: 4
Reputation: 11268
This likely happens when Google algorithms find any suspicious link in the body of your email. You can consider removing any links from the email and try sending the message again to confirm the issue.
The Google support site has more information.
Upvotes: 3