使用应用程序脚本进行emaling到非gmail帐户

时间:2016-06-16 15:28:24

标签: javascript google-apps-script

function onSubmit(e) {
//.......  
var NewSpreadSheetID = NewSpreadSheet.getId();
var File = Drive.Files.get(NewSpreadSheetID);
var url = File.exportLinks[MimeType.CSV];
var token = ScriptApp.getOAuthToken();
var response = UrlFetchApp.fetch(url, {
headers: {
'Authorization': 'Bearer' + token
}
});

var blobs = [response.getBlob().setName(DirectoryName)];




if (EmailBoolean == "yes") {
var UserEmail = e.response.getResponseForItem(frm[130]).getResponse().toString();
var CreatorEmail = Session.getEffectiveUser().getEmail();

MailApp.sendEmail({
to : UserEmail,
subject: "Your project spreadsheet",
attachments: blobs
});
}


MailApp.sendEmail({
to : CreatorEmail,
subject: "Your project spreadsheet",
attachments: blobs
});
}

当此电子邮件发送到非Gmail帐户(例如hotmail帐户)时,该文件基本上作为链接附加到重定向用户以登录g-mail帐户的网站。

0 个答案:

没有答案