MailApp.sendEmail在google应用程序脚本中未设置为时向自己发送电子邮件 MailApp.sendmail({ 至:someemail@gmail.com , ", 主题:“+variable1+”在“+variable2”处的新更改, htmlBody:“添加:”+addedlist_new.toString()+“”+ “已删除:“+removedlist\u old.toString()+””+ " https://docs.google.com/spreadsheets/d/someurlhere ", })

MailApp.sendEmail在google应用程序脚本中未设置为时向自己发送电子邮件 MailApp.sendmail({ 至:someemail@gmail.com , ", 主题:“+variable1+”在“+variable2”处的新更改, htmlBody:“添加:”+addedlist_new.toString()+“”+ “已删除:“+removedlist\u old.toString()+””+ " https://docs.google.com/spreadsheets/d/someurlhere ", }),email,google-apps-script,Email,Google Apps Script,当我收到一封发给我以外的用户的电子邮件时,我发现我的收件箱里有一封发给他们的电子邮件。它显示它已发送给我在“收件人”区域输入的用户,但它在我的收件箱中。为什么它会将其放在我的收件箱而不是已发送的邮件中?请尝试以下方法: MailApp.sendEmail({ to: " someemail@gmail.com , ", subject: "New change for " + variable1+ " at " + variable2, htmlBody: "Added: " + addedli

当我收到一封发给我以外的用户的电子邮件时,我发现我的收件箱里有一封发给他们的电子邮件。它显示它已发送给我在“收件人”区域输入的用户,但它在我的收件箱中。为什么它会将其放在我的收件箱而不是已发送的邮件中?

请尝试以下方法:

MailApp.sendEmail({
to: " someemail@gmail.com , ",
subject: "New change for " + variable1+ " at " + variable2,
htmlBody: "Added: " + addedlist_new.toString() + "<br><br>" + 
"Removed: " + removedlist_old.toString() + "<br><br>" +
" https://docs.google.com/spreadsheets/d/someurlhere ",
})
var-toEmail=”someemail@gmail.com";
var subject=“对“+variable1+”在“+variable2”进行的新变更;
var messageBody=“添加:“+addedlist\u new.toString()+”

“+”删除:“+removedlist\u old.toString()+”

“+”https://docs.google.com/spreadsheets/d/someurlhere"; sendmail(toEmail,主题,“,{htmlBody:messageBody});
我遇到了这个问题,发现用
Gmailapp.sendmail
替换
Mailapp.sendmail
有效。

是在你的收件箱中,还是你也看到了你发送的邮件?电子邮件从您的帐户发送,发送人设置为您。它在我的收件箱中作为“收件人”字段显示为其他人。这就像“已发送”的电子邮件在收件箱中,而不是已发送的邮件。为什么会这样?这可能是由于以下原因之一:或者您正在使用启用了“从不发送到垃圾邮件”选项的过滤器,该过滤器(可能是意外地)与您发送的邮件匹配,它们将显示在收件箱中。或者其中的一个原因是我没有任何筛选器导致此问题。可能会删除上引号内的逗号,使其
成为:someemail@gmail.com“,
您必须为脚本提供Gmail权限(如果您还没有)。还要考虑到,这种发送方式不会在您的“已发送”文件夹中注册,而且会在MailApp中注册(除了在您的收件箱中弹出)
var toEmail = "someemail@gmail.com";

var subject = "New change for " + variable1+ " at " + variable2;

var messageBody = "Added: " + addedlist_new.toString() + "<br><br>" + "Removed: " + removedlist_old.toString() + "<br><br>" + "https://docs.google.com/spreadsheets/d/someurlhere";

MailApp.sendEmail(toEmail , subject , "" , {htmlBody: messageBody});