Closed palexvs closed 4 years ago
Can you please provide a sample application that reproduces the error?
I had no issue with letter_opener on Catalina 10.15.6, rails 5.2.4.3, letter_opener 1.70 and launchy 2.5.0. Mailer called from rake task. Also worked in rails console.
thanks @bjer! Closing this for now. @palexvs feel free to ping me if you still have an issue and have sample app that reproduces it.
If you run into this problem, you'll need to change the OS's default file-opener for .html
files to be your web browser.
For anyone struggling with _letteropener not working in some cases, I think I've knocked out the problem. It's not really related to this gem directly although the error message could be a bit better.
Debugging steps:
develpment.rb
) set config.action_mailer.raise_delivery_errors = true
and reset server (or console)if !mail.smtp_envelope_from || mail.smtp_envelope_from.empty? ..
in LetterOpener:DeliveryMethod:validate_mail!
As you can see, you probably have not configured the from address for that particular email
In my case error was located in Devise configuration which used to lack sender config. Adding sth like this in initialized solved the problem:
Devise.setup do |config|
config.mailer_sender = "your@email.com" # change to your valid email
end
Hope that helped someone
Anyone still facing this issue? On Terminal it seems to be working but the email is not poping up on Chrome's Tab.... Rendering user_mailer/welcome.html.erb within layouts/mailer Rendered user_mailer/welcome.html.erb within layouts/mailer (Duration: 1.0ms | Allocations: 252) UserMailer#welcome: processed outbound mail in 7.9ms Delivered mail 626dcf043ce90_51643fc55a01a040688ab@Danniels-MBP.mail (5.8ms) Date: Sat, 30 Apr 2022 21:06:28 -0300 From: dwftung@gmail.com To: danniel@gmail.com Message-ID: 626dcf043ce90_51643fc55a01a040688ab@Danniels-MBP.mail Subject: Cop or Drop Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
<!DOCTYPE html>=0D
=0D =0D =0D =0D =0D =0D =0D =0DSeja bem-vindo danniel@gmail.com!
=0DSegue c=C3=B3digo de valida=C3=A7=C3=A3o: 776142
=0D =0D =0D => #
MacOs Catalina 10.15.5
In one console I run Rails server:
In another, I open the Rails console and try to send an email:
But nothing opens in browser