Message blocked when sending email from Google Script

孤街醉人 提交于 2020-06-26 06:47:12

问题


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("myemail@gmail.com",emailSubject,"", {htmlBody: body, cc: "anotheremail@gmail.com, thirdemail@gmail.com"});

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: <000000000000eb73c1057a773c96@google.com>

Final-Recipient: rfc822; myemail@gmail.com
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)

回答1:


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!




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/53262939/message-blocked-when-sending-email-from-google-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!