This project is archived and is in readonly mode.

#5255 ✓invalid
eydaimon

ActionMailer 3.0 drops name part in email

Reported by eydaimon | July 30th, 2010 @ 08:04 PM

Example:

m = mail to: "Name <address@mail.com>"
m.to.first
#=> "address@mail.com"

Notice how the to: header drops the "Name" part of the address.

Edited by Rohit Arondekar for formatting.

Comments and changes to this ticket

  • eydaimon

    eydaimon July 30th, 2010 @ 08:04 PM

    • Tag changed from rails 3.0.rc to rails 3.0.0.beta3
  • Rohit Arondekar

    Rohit Arondekar October 7th, 2010 @ 06:51 AM

    • Importance changed from “” to “Low”

    However the information is not completely lost, it's stored somewhere.

        m = mail :to => "Name <address@mail.com>"
        m.inspect
        #<Mail::Message:26124640, Multipart: false, Headers: <From: from@example.com>, <To: Name <address@mail.com>>, <Subject: Welcome email>, <Mime-Version: 1.0>, <Content-Type: text/plain>>
    

    Did you have any specific issue or can this ticket be closed?

  • eydaimon

    eydaimon October 7th, 2010 @ 03:59 PM

    E-Mail clients render the name field to display the email better, so it's definitely desired. It's standard, and I'm quite surprised you're suggesting just closing the ticket and ignoring this.

  • Aditya Sanghi

    Aditya Sanghi October 7th, 2010 @ 05:31 PM

    • Assigned user set to “Mikel Lindsaar”

    @eydaimon , i think what rohit is trying to probably say is that email clients don't do "m.to.first" to display the sender. The mail object within a rails, has sufficiently stored the attributes of the mail message. Mail gem converts it into an email message and transfers it as per the RFC (cant recall the number just now) to the clients.

    I too disagree that m.to.first is sufficient evidence that this functionality is not working.

    After some introspection, i found that the way you probably want to test it is -

      m[:to].formatted == "Name <address@mail.com>".
    

    If you indeed think its a bug, you may want to raise it against the mail gem at http://github.com/mikel/mail but i doubt it will stand.

    Perhaps, Mikel can chime in since he is the maintainer of that gem as well as ActionMailer.

  • eydaimon

    eydaimon October 7th, 2010 @ 06:51 PM

    @aditya, thanks for the clarification. I re-read the thread and you're correct. For some reason I thought it wasn't being included in the sent-mail when I responded again which is not true.

    Please close this ticket.

  • David Trasbo

    David Trasbo October 7th, 2010 @ 08:27 PM

    • State changed from “new” to “invalid”

    Done!

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages