Sending large email attachments with actionmailer and heroku from s3

℡╲_俬逩灬. 提交于 2019-12-11 03:38:39

问题



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 Could not send e-mail, max size of 20480000 bytes exceeded

1). Firstly i do not understand why it fails as, 16Mb < 20480000 bytes(+/-19 Mb)
2). How can i mail files larger than 19Mb

I am using heroku's sendgrid addon, and rails 3 with amazon s3


回答1:


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.



来源:https://stackoverflow.com/questions/6832726/sending-large-email-attachments-with-actionmailer-and-heroku-from-s3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!