本文介绍了无法使用应用程序脚本UrlFetchApp获取共享的Google驱动器链接(任何人)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我能够获取并通过电子邮件发送img2,但是当我尝试与所有人共享的图像时,以下内容失败,电子邮件仅显示一个空框.什么锣呢?TIA.

I am able to fetch and email the img2 but when I tried a shared-with-everyone image the below failsvand the email shows only empty box. What is gong on?TIA.

    function sendEmail() {
//      var img2 = "https://upload.wikimedia.org/wikipedia/commons/3/38/JPEG_example_JPG_RIP_001.jpg"
      var img = "https://drive.google.com/open?id=19JSe5jLnlllnUoYZlimeWAC39qLXwWs-"
        var subject = "Subject";
        var msgBody = "Body";
        var imgFetch = UrlFetchApp
        .fetch(img2)
        .getBlob()
        .setName("imgFetch");

        msgBody = "<img src='cid:thisImg' style='width:100px; height:70px;' />";

        MailApp.sendEmail(mail, subject, "",
                          { htmlBody: msgBody + "<BR/><BR/>",
                           inlineImages:
                           {
                           thisImg: imgFetch,
                          }
                          });
    }

推荐答案

此修改如何?在此修改中,对端点进行了修改.

How about this modification? In this modification, the endpoint was modified.

var img = "https://drive.google.com/open?id=19JSe5jLnlllnUoYZlimeWAC39qLXwWs-"

收件人:

var img = "https://drive.google.com/uc?id=19JSe5jLnlllnUoYZlimeWAC39qLXwWs-"

这篇关于无法使用应用程序脚本UrlFetchApp获取共享的Google驱动器链接(任何人)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 23:58