ryanb / letter_opener

Preview mail in the browser instead of sending.
MIT License
3.73k stars 237 forks source link

1.6.0 adds requirement for to address #153

Closed axlekb closed 6 years ago

axlekb commented 6 years ago

I recently upgraded from 1.5.0 to 1.6.0 and letter_opener now fails to launch emails without a to address. It is valid to send email with only cc or bcc. These emails previously did not fail and should raise errors.

# lib/letter_opener/delivery_method.rb#29
if !mail.to || mail.to.empty?
  raise ArgumentError, "SMTP To address may not be blank"
end
nashby commented 6 years ago

@axlekb hi! Thanks, good catch. I've fixed that in master.

axlekb commented 6 years ago

Thank you!!!

yanghoxom commented 10 months ago

for someone who was using the newest version but still can not raise the crash on local environment you can recheck the config to make sure you added this

config.action_mailer.raise_delivery_errors = true