MailApp.sendEmail方法无法访问正文中具有URL的帐户-邮件被阻止 [英] MailApp.sendEmail method doesn't get through to accounts with URL in the body - Message Blocked

查看:139
本文介绍了MailApp.sendEmail方法无法访问正文中具有URL的帐户-邮件被阻止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Google Apps脚本。我正在尝试发送电子邮件,如下所示:

  function test_sendmail(){
var subject = subject;
var body = https://www.google.com/;
var emailBody =正文;
var选项= {
htmlBody:正文
}

var收件人= XXXXXXXXX@gmail.com;

MailApp.sendEmail(收件人,主题,emailBody,选项);
}

XXXXXXXXX@gmail.com (电子邮件地址A)无效,但仅用于显示示例。我在GAS执行中使用了真实的电子邮件地址。



GAS执行是由另一个G-suite域google帐户(电子邮件地址B)运行的,该帐户的代码是



电子邮件地址A具有在GAS编辑器中具有以上代码的电子表格的编辑权。



但是,来自上述功能的电子邮件无法通过电子邮件地址A。我在电子邮件地址B中获得了此电子邮件。





了解更多信息:



最近一次,例如从1周或2周前,发送带有URL的电子邮件到电子邮件地址(例如电子邮件地址A)失败。在此之前,这4例案件以前都是成功完成的。我不知道为什么最近会这样。



我检查了发件人电子邮件地址B是否在收件人电子邮件地址A的联系人列表中。



它不在我的联系人中。



但是当我搜索它时,它就出现了,所以它出现在中所有联系人





< hr>

添加了1:
我尝试将电子邮件发送到电子邮件地址C,这是与该域相同的另一个G-suite邮件地址电子邮件地址B,但电子邮件地址C没有电子表格和编辑者的权限。



即使没有电子表格的权限,它也已成功发送到电子邮件C 。






已添加2:
我尝试将电子邮件发送到电子邮件地址D这是既不是G-suite域也不是@ google.com地址的其他电子邮件地址。结果与电子邮件地址A相同。





解决方案

Gmail anti-垃圾邮件算法很复杂。为防止脚本发送的消息被它们阻止,请遵循防止发送给Gmail用户的邮件被阻止或发送到垃圾邮件






可能的解决方法



我的一个客户遇到了同样的问题,我将 MailApp.sendEmail(message)替换为 GmailApp.sendEmail(收件人,主题,正文,选项)显然有效(10分钟后没有退信)



Rafa Guillermo在评论中添加:


在这种情况下,只需添加,如果这是一个持续存在的问题,您应该让您的管理员联系 G Suite支持


如果您无法获得G Suite支持,我认为您可以使用Google反馈(Open Gm所有网络用户界面>单击设置按钮(齿轮图标)>发送反馈)



相关




I am working on Google Apps Script. I am trying to send email as follows:

function test_sendmail(){
  var subject = "subject";
  var body = "https://www.google.com/";
  var emailBody = body;
  var options = {
    htmlBody: body
  }

  var recipient = "XXXXXXXXX@gmail.com";

  MailApp.sendEmail(recipient, subject, emailBody, options);
}

"XXXXXXXXX@gmail.com"(email address A) is not valid, but it's only for showing you an example. I use a real email address in the GAS execution.

The GAS execution is run by another G-suite domain google account(email address B) by which account the code is written.

The email address A has editing rights to the spreadsheet that has the above code in the GAS editor.

But, the email from the above function doesn't get through the email address A. I got this email in the email address B.

LEARN MORE: https://support.google.com/mail/answer/6596?visit_id=637267406328019079-2003975007&rd=1

Then, I replace the email address with the email address B. and I tried to send it, and it did get through successfully.

Secondly, I changed the URL part:

var body = "https://www.google.com/";

to:

var body = "";

Then, the email successfully get through to both email addresses A and B.

The results listed as below:

The failure of sending email with URL to email address like the email address A has occurred recently like from 1 week or 2 weeks ago. Until then, the 4 cases had been successfully done before. I have no idea why this started happening recently.

I checked if the sender email address B is in the contact list of the recipient email address A.

It is not in my contacts.

But when I searched it, it appeared, so it seems in all contacts.


Added 1: I tried sending email to the email address C which is another G-suite mail address in the same domain as the email address B, but email address C doesn't have rights to the spreadsheet and the editor.

It sent to the email C successfully even it has no right to the spreadsheet.


Added 2: I tried sending email to the email address D which is other email address that is neither G-suite domain or @google.com address. The result is the same as the email address A.


解决方案

Gmail anti-spam algorithms are complex. To prevent that the messages sent by your script being blocked by them, follow the guidelines on Prevent mail to Gmail users from being blocked or sent to spam


Possible Workaround

One of my clients had the same issue, I replaced MailApp.sendEmail(message) by GmailApp.sendEmail(recipient,subject,body,options) apparently this worked (No bounce messages after 10 minutes)

Rafa Guillermo added in a comment:

Just want to add that in this case if this is an ongoing issue you should get your admin to contact G Suite support

If you hasn't access to G Suite Support I think that you could report this issue to Google by using Google Feedback (Open Gmail web UI > click the settings button (gear icon) > Send feedback)

Related

这篇关于MailApp.sendEmail方法无法访问正文中具有URL的帐户-邮件被阻止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆