问题
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