Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NameError: uninitialized constant Mail::Parsers::ContentTransferEncodingParser

Sometimes when I send mass email on heroku some of them fail with the following error: NameError: uninitialized constant Mail::Parsers::ContentTransferEncodingParser

I have no idea why is that but I think that maybe this maybe caused by using attachments.inline in mailer. Any ideas what may cause this problem?

like image 253
Mateusz Urbański Avatar asked Nov 09 '15 18:11

Mateusz Urbański


1 Answers

I create initializer with following line:

Mail.eager_autoload! if Rails.env.production? && defined?(Mail)

and that fixes the problem.

like image 136
Mateusz Urbański Avatar answered Nov 15 '22 13:11

Mateusz Urbański