关于此脚本,我可以在电子邮件上附加图片:
function myTesteMail() {
var file = DriveApp.getFileById('1DyNggP_DAZEO32kSdQTZFiEYG1bPCP3o');
MailApp.sendEmail('xxxxxx@yyyyyy.com', 'Attachment example', 'my own test.', {name: 'my Script', attachments: [file.getAs(MimeType.JPEG)]});
}
如何在电子邮件中直接添加picutre?
有可能吗?
谢谢
答案 0 :(得分:0)
您可以使用htmlBody
中的MailApp.sendMail
参数在电子邮件中直接添加图片。您可以看到documentation for MailApp
here。
function myTesteMail(){
var email = 'user@domain.ext';
var subject = 'Subject Test';
MailApp.sendEmail(email, subject, "", {
htmlBody: " <html>\
<body> Look at this email body \
<img src='https://www.domain.ext/image.jpg' border='0' alt='error'
align='middle'></th>\
</body>\
</html>"
});
}