1
我可以创建PDF文件,在Acrobat本地查看,通过电子邮件发送它使用流星电子邮件包,收到附件,但它是腐败的。 Acrobat无法打开它,并且实际上说“文件已损坏”,并且表明电子邮件解码可能是问题。流星电子邮件pdf附件与邮件
我试过“application/octet-stream”没有运气。有任何想法吗?
Email.send({
to: "[email protected]",
from: from,
subject: fn.alertTypeLabel + ' ' + p[0].parameterLabel,
html: SSR.render(template, templateDataContext),
attachments : [ { fileName : fileName, filePath : filesPath, contentType : contentType } ]
});
附件contentType设置为"application/pdf"
。
嗨Joos:你的解决方案效果很好。谢谢。我正在使用第三方工具来保存pdf。所以在第三方的回调中(文件保存成功后),我调用了readFile,并在readFile的回调函中发送了电子邮件。我不得不将这些回调包装在Meteor.bindEnvironment中以供它们使用。 – SudiB
不错,很高兴听到! – Joos