从S3使用Actionmailer和Heroku发送大型电子邮件附件 [英] Sending large email attachments with actionmailer and heroku from s3
问题描述
我有一个应用程序,可以在s3中存储上载的文件,完成后,将随附件一起发送邮件。当附件的大小在0-15 Mb之间时,该应用程序可以正常运行。但是,当我附加较大的东西(例如16 Mb)时,它失败并返回错误:
i have an app that stores uploaded files in s3, once complete a mail is sent with the attached file. The app works fine when attachments are between 0-15 Mb in size. However when i attached something larger like 16 Mb it fails and returns the error:
Net :: SMTPFatalError:550无法发送电子邮件,最大大小为超出20480000字节
1)。首先,我不明白为什么它会失败,因为16Mb < 20480000字节(+/- 19 Mb)
2)。我如何邮寄大于19Mb的文件
1). Firstly i do not understand why it fails as, 16Mb < 20480000 bytes(+/-19 Mb)
2). How can i mail files larger than 19Mb
我正在使用heroku的sendgrid插件,以及Rails 3和Amazon s3
I am using heroku's sendgrid addon, and rails 3 with amazon s3
推荐答案
通常,当您将二进制文件附加到邮件中时,它会转换为ASCII格式,并且大小会增加大约30%-在您的情况下,这意味着最大文件附件可以具有在15到1600万之间。
Normally when you attach a binary file to a mail message it gets translated to an ASCII format, and the size grows with about 30% - in your situation that means the maximum file attachment can have somewhere between 15 and 16M.
这篇关于从S3使用Actionmailer和Heroku发送大型电子邮件附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!