You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Gmail邮件追踪器功能正常,如何替换问号图标为实际图片?

邮件追踪图片在Gmail显示[?]图标的解决思路求助

我参考多年前的StackOverflow帖子,用Google Sheets制作了一个邮件追踪图片。该追踪器能正常将邮件打开状态记录到Google Sheet中,但在Gmail里显示的是[?]图标,而非预期的图片。

我只需将以下HTML生成的图片代码复制粘贴到邮件中,就能在Google Sheet查看邮件打开记录:

<img src="https://script.google.com/macros/s/AKfycbyRRnH5iALMqMlgMs3QiWcdI3LiXgLXBtYTGNVBppmsKi_7-0An5PTmrSt0JYLT7m5g/exec?src=CodePen" />

效果如下:
显示的问号图标
Google Sheet中的邮件打开记录

我使用的AppScript代码和用来复制渲染后追踪图片到Gmail的CodePen均可测试。

我的需求是:发送邮件时显示实际图片,而非[?]图标。

我试过这段代码,在浏览器中能显示一个红点:

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="/>

因此我尝试让GET API调用返回该data...==文本,以为HTML会识别它,但并未生效。求解决思路?

更新1

我优化了问题描述以减少歧义。根据评论中的方法更新了AppScript,使其返回包含图片URL或上述base64对象的HTML,但仍显示[?]图标。现在用Postman调用GET API会返回如下内容:

<!doctype html>
<html>

<head>
    <meta name="chromevox" content-script="no">
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"
        nonce="VO2qwIJjLxZif_nTwjioww">
    <link rel="stylesheet" href="/static/macros/client/css/2972996970-mae_html_css_ltr.css">
    <script type="text/javascript" src="/static/macros/client/js/4136683848-warden_bin_i18n_warden.js"></script>
</head>

<body>
    <table id="warning-bar-table" class="full_size" cellspacing="0" cellpadding="0">
        <tr>
            <td>
                <div id="warning" class="warning-bar"></div>
            </td>
        </tr>
        <tr>
            <td style="height: 100%"><iframe id="sandboxFrame"
                    allow="accelerometer *; ambient-light-sensor *; autoplay *; camera *; clipboard-read *; clipboard-write *; encrypted-media *; fullscreen *; geolocation *; gyroscope *; magnetometer *; microphone *; midi *; payment *; picture-in-picture *; screen-wake-lock *; speaker *; sync-xhr *; usb *; web-share *; vibrate *; vr *"
                    sandbox="allow-downloads allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation allow-storage-access-by-user-activation">
                </iframe>
            </td>
        </tr>
    </table>
    <script nonce="0SAAOkgbuqtmkYBmeBotjA">
        (function() {
var el = document.getElementById('sandboxFrame');
el.onload = function() {
goog.script.init("\x7b\x22functionNames\x22:\x5b\x22doPost\x22,\x22doGet\x22,\x22processResult\x22,\x22processRequest\x22,\x22test\x22,\x22testGet\x22\x5d,\x22sandboxMode\x22:\x22IFRAME_SANDBOX\x22,\x22callbackTimeout\x22:390000,\x22deploymentId\x22:\x22AKfycbyV9pX-2IejSGmic_bxCcm-uAGehnB5HoqPdLloyv0nnjf2Kw5zWbfHntJEFd0LGM2P\x22,\x22eei\x22:\x22\x22,\x22sandboxHost\x22:\x22https:\/\/n-hsuo5icdlgt7jj4tkbxzfgmypt6kltl2howxigy-0lu-script.googleusercontent.com\x22,\x22clientSideProperties\x22:\x7b\x22google.script.sandbox.mode\x22:\x22IFRAME_SANDBOX\x22,\x22google.script.host.origin\x22:\x22https:\/\/docs.google.com\x22\x7d,\x22actionPrefix\x22:\x22\/macros\/s\/AKfycbyV9pX-2IejSGmic_bxCcm-uAGehnB5HoqPdLloyv0nnjf2Kw5zWbfHntJEFd0LGM2P\x22,\x22userHtml\x22:\x22\x3cimg src \x3d \\x22https:\/\/deafassistant.com\/images\/logo-dark.png\\x22\x3e\x22,\x22ncc\x22:\x22\x7b\\x22awhs\\x22:true\x7d\x22\x7d", "", undefined, true , false  , "false", "https:\/\/n-hsuo5icdlgt7jj4tkbxzfgmypt6kltl2howxigy-0lu-script.googleusercontent.com", "\/\/drive.google.com\/abuse?id\x3dAKkXjoyWDgnsm9PsAF_BuBBvs0iOEeCXFbzzoMzKOqvAqAHlCbFd9J-o-WpTmnhuQ86AXAeDF6ywqfnS-O0oRRwHFebQx4ydYFg5B6fX%3A0");}
el.src = 'https:\/\/n-hsuo5icdlgt7jj4tkbxzfgmypt6kltl2howxigy-0lu-script.googleusercontent.com\/userCodeAppPanel';
}());
    </script>
</body>

</html>

内容的提问来源于stack exchange,提问作者Saamer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.01 23:49:52