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

blastula v0.3.4附件命名异常:附件显示为‘Filename’无扩展名

Blastula 附件名称显示异常解决方法

使用blastula v0.3.4发送带附件邮件时,附件内容正确但名称变为无扩展名的Filename,而非指定的my_attachment.html,可通过以下方式解决:

核心修复方案

在add_attachment()函数中明确指定附件的MIME类型,避免邮件客户端无法识别扩展名:

修改后的邮件附件添加代码:

email <- compose_email(
  body = md("Please see the attached HTML file for details.")
) %>%
  add_attachment(
    file = output_file_body,
    filename = 'my_attachment.html',
    content_type = "text/html"  # 明确指定HTML类型
  )

额外优化建议

  • 升级blastula至最新版本(如v0.4.2及以上),官方已修复部分旧版本的附件命名问题:
install.packages("blastula")
  • 确认本地生成的output_file_body文件路径正确,文件本身带有.html扩展名。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.02 10:25:04