我尝试在邮件正文中发送S3 url文件,但收到错误
Errno::ENOENT: No such file or directory @ rb_sysopen
我想要这样的东西,但我无法实现这一点
@path = s3_url
attachments["output.pdf"] = {
mime_type: "application/pdf",
content: HTTParty.get(@path).response.try(:body)
}
mail(to: 'xyz@gmail.com', subject: "Test Attchment", body: File.read(URI.parse(@path)))
1条答案
按热度按时间jc3wubiy1#
使用Net::HTTP或HTTPary获取PDF并读取响应以在邮件程序中设置附件。
试着这样做: