1

I want to send emails with formatted sender such as "Support team foo@bar.com".

If delivery method I wrote from "support team <foo@bar.com>" and from "\"support team\" <foo@bar.com>" but smtp server says

#<Net::SMTPSyntaxError: 501 <support team <foo@bar.com>>: "@" or "." expected after "support"

This means that rails puts full "from" string into braces. How can I fix this without monkeypatching?

Andrey Kuznetsov
  • 11,640
  • 9
  • 47
  • 70
  • 1
    What version of Rails? Is it possible you're using one affected by https://rails.lighthouseapp.com/projects/8994/tickets/2340 / https://rails.lighthouseapp.com/projects/8994/tickets/3078-actionmailer-233-broke-display-name-support-in-from-address-when-using-smtp – mikej Apr 05 '10 at 12:47

1 Answers1

3
 @from         = "\"support team\" <foo@bar.com>"

Ref:- Rails ActionMailer - format sender and recipient name/email address

http://jrmehle.com/2009/05/09/setting-email-and-name-with-actionmailer/

OR TRY

From        ["support team <foo@bar.com>"]
Community
  • 1
  • 1
Salil
  • 46,566
  • 21
  • 122
  • 156