Skip to content
Browse files

1.9 compatibility - don't pass an array as the from address as this e…

…nds up generating invalid SMTP commands.
  • Loading branch information...
1 parent 74c1249 commit 1d57ccbc6f80a506e5c3867976793310e9148f03 Friedrich Göpel committed with NZKoz Jun 9, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionmailer/lib/action_mailer/base.rb
View
2 actionmailer/lib/action_mailer/base.rb
@@ -697,7 +697,7 @@ def create_mail
def perform_delivery_smtp(mail)
destinations = mail.destinations
mail.ready_to_send
- sender = (mail['return-path'] && mail['return-path'].spec) || mail.from
+ sender = (mail['return-path'] && mail['return-path'].spec) || mail['from']
smtp = Net::SMTP.new(smtp_settings[:address], smtp_settings[:port])
smtp.enable_starttls_auto if smtp_settings[:enable_starttls_auto] && smtp.respond_to?(:enable_starttls_auto)

2 comments on commit 1d57ccb

@travissinnott

This breaks compatibility with Ruby 1.8 when the from address has a display name included (eg. "My Name name@address.tld")

@travissinnott

that should read: "My Name <name@address.tld>"

Please sign in to comment.
Something went wrong with that request. Please try again.