我正在尝试设置的脚本使用MailApp服务将电子邮件发送给Ghseet中包含的收件人。
function sendProcessingEmail() {
var customerId = AdsApp.currentAccount().getCustomerId();
if (config.emailEachRun && config.emailRecipients &&
config.emailRecipients.length) {
MailApp.sendEmail(
config.emailRecipients.join(','),
customerId + ': Link Checker: Checking is ongoing',
'Link checking is still running on account: ' + customerId +
'. For more details see the spreadsheet: ' +
CONFIG_SPREADSHEET_URL);
setDateAsNow('dateEmailed');
我已经注意到,该脚本适用于由数字和字母组成的电子邮件,但是当地址包含其他字符时,则无法发送电子邮件。想知道是否有人知道解决方法吗?提前非常感谢。
向带有特殊字符在电子邮件地址中]的收件人发送电子邮件没有问题。这个例子很好用:
function main () { MailApp.sendEmail('[email protected]', 'test message', 'this works') }
但是,如果其中一封电子邮件不是有效的电子邮件(例如
[email protected],-,[email protected]
),则脚本填充失败。在加入之前,请考虑过滤config.emailRecipients以匹配电子邮件模式。可以找到许多可能的正则表达式进行过滤here