0

What I'm trying to do is format the email address like so Foo Bar <foo@bar.com> so email clients (including web based like gmail) will show the sender as "Foo Bar" and not just "foo" since that is the prefix on the email.

Is this possible in Magento 1.5? If I try to put the formatting in the field itself I get an error message.

enter image description here

jyoseph
  • 5,435
  • 9
  • 45
  • 64

3 Answers3

1

That's what the Sender Name field does. This is what my setup looks like and what it looks like in Thunderbird (my webmail client formats it similarly, too):

image

Bo Persson
  • 90,663
  • 31
  • 146
  • 203
Alex Jegtnes
  • 177
  • 10
0

You may look at code/core/Mage/Core/Model/Email.php for the actual mail implementation. You may notice it uses Zend_Mail. Now, here is the catch:

For security reasons, Zend_Mail filters all header fields to prevent header 
injection with newline (\n) characters. Double quotation is changed to single 
quotation and angle brackets to square brackets in the name of sender and recipients. 
If the marks are in email address, the marks will be removed.

What you can do though is to make a module to rewrite the current class Mage_Core_Model_Email and overwrite the send() function. I covered rewriting classes before in this question's answer. Then, in this new rewritten class, you could PHPmailer, invoke shell mail commands, or whatever PHP library you would happen to know that would allow this behaviour.

Best of luck.

Community
  • 1
  • 1
Seth Malaki
  • 4,436
  • 23
  • 48
0

I'm not sure if it can work. In magento inside is a Zend_Validate which does validation of such email addresses. And I dont think so that email like 'Foo Bar ' is valid. But I think the display in customer's email client depend on client, no?

Jaro
  • 3,799
  • 5
  • 31
  • 47