【问题标题】:How to ensure Google Drive links in an html document sent via email are not recognized as attachments?如何确保通过电子邮件发送的 html 文档中的 Google Drive 链接不被识别为附件?
【发布时间】:2015-06-01 09:47:59
【问题描述】:

我正在使用 App Scripts 以 html 格式呈现一封电子邮件,其中包含其 href 属性链接到 Google Drive 文档的标签。

应用脚本按预期运行,但是当我打开 Gmail 中发送的电子邮件时,所有链接的 Google Drive 文档都显示为电子邮件的附件。

如何删除该功能?

目前使用以下MailApp方法:

MailApp.sendEmail({
    to: emailAddresses,
    noReply: true,
    subject: subject,
    htmlBody: htmlStr,
});

编辑:

一个不太理想的解决方案是通过像 goog.le 这样的 url-shortener 运行各种 google drive 文档链接

尽管这确实完成了工作,因为识别 google drive 文档链接的默认 gmail 进程现在不再能够解析 google drive 文档链接,但我希望能够提供一些标题上下文通知上述默认 gmail 进程不要将 google drive 文档链接解析为附件。

【问题讨论】:

    标签: javascript html email google-apps-script gmail


    【解决方案1】:

    我尝试使用以下 Html 脚本发送电子邮件:

    <html>
      <head>
    
      </head>
      <body>
      <a href="https://docs.google.com/spreadsheets/d/1234546789123456789/edit#gid=0">link</a>
        <p>
          This a test for a Go-To action in Gmail.
    
    
        </p>
      </body>
    </html>
    

    它工作并将其显示为 href 但不是附件。希望对您有所帮助!

    【讨论】:

    • 感谢您的回复,但是我不知道您在上面的a 标签中包含的示例href 是否完全解决了这个问题。如果href 是实际的 google 文档,您可能会看到正在尝试解决的问题。
    猜你喜欢
    • 2013-07-26
    • 1970-01-01
    • 2016-04-08
    • 1970-01-01
    • 2016-07-14
    • 2017-05-27
    • 1970-01-01
    • 1970-01-01
    • 2011-02-27
    相关资源
    最近更新 更多