dreamer2014520 2012-05-10 23:21 采纳率: 0%
浏览 59
已采纳

说服电子邮件客户端不要内联显示html附件?

Problem: I send out an email (using phpmailer and sendmail) which has a complex html attachment. I don't want the email client to attempt to display the attachment, since it's far too complex to be viewed in a mail reader.

As far as I can make out, the way to do this is to set content-Disposition to attachment. The default in phpmailer is to set it to attachment anyway. However, Thunderbird (the only client I've tested so far) does actually attempt to display the html. If I view the headers in Thunderbird, I can't see a Content-Disposition, but if I save the mail I can see:

--b1_420d367a26870bbc3bae73fb1de31f49
Content-Type: application/octet-stream; name="chart.html"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="chart.html"

Thunderbird has given the attachment the correct name, so it presumably understands the Content-Disposition. Is there something I can do with phpmailer to stop clients displaying html attachments, or can clients just do what they want?

Sending a compressed file isn't really an option - the users may not be sophisticated enough to know what to do with it.

  • 写回答

2条回答 默认 最新

  • dongqintong8972 2012-05-11 01:09
    关注

    David :Bienvenu 2006-04-07 12:49:31 PDT for historical reasons, this is done intentionally and has been since Netscape 2.0 and Mozilla 1.0...we display inline the attachments we know how to display unless you turn off view | attachments inline. Perhaps we could add a pref for respecting the content-disposition for all attachment types.

    https://bugzilla.mozilla.org/show_bug.cgi?id=147461

    This has been a known behavior since at least 2002. As far as forcing it to not be displayed inline, I'm not sure that it can be done except by the user setting a pref as mentioned in the bug report.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题