Joy
Joy

Reputation: 4483

Sending zip file as attchment in Ruby on Rails

I have zipped several files in my ruby script. Before attachment total sizes of all files is almost 12 MB and after zipping size of the result file is almost 8.3 MB which is attachment.zip. I am sending this file using actionmailer as attachment as follows:

attachments[file_name] = File.read(path_of_the_file)
receivers = ["[email protected]", "[email protected]"]
mail(:to => receivers, :subject => subject, :body => "").deliver

But the problem is that it keeps giving error 554 Message rejected: Stream is more than 10485760 bytes long. It is giving the same error while I was sending the files individually before zipping. I have no idea how to fix this. So I will be really grateful if anyone helps to fix this issue.

Upvotes: 2

Views: 1431

Answers (1)

Jon
Jon

Reputation: 10898

The message is being rejected by the server your app is connecting to.

Either make your message smaller than 10485760 bytes, or use a different server to send your mail which doesn't have that restriction.

Upvotes: 2

Related Questions