Snowalker
Snowalker

Reputation: 309

What HTML entity to use in the email subject line for a heart?

This question may sound like stupid but I tried all possible HTML entities and the subject line for the email I send is still not showing the heart on Apple devices (iPhone, iPad, etc).

It may be just the software I use for testing (MaxBulk Mailer, ExactTarget).

I also tried different charset (UTF-8, ascii, etc).

Does anybody know how to make a heart appear as a heart into the subject line of an email for Apple devices?

Upvotes: 2

Views: 11539

Answers (2)

lukeA
lukeA

Reputation: 54247

With regards to your question here: you may have picked the wrong heart. Try ♥ instead of ❤. The first one should render on a BlackBerry (and Android 2.2), too, as this test shows. The latter one, however, doesn't.

Upvotes: 3

deceze
deceze

Reputation: 522442

The subject line is part of the email headers. The email headers may only contain ASCII characters. The subject line is not being interpreted as HTML or anything else, it's plain text. You need to embed the character as Unicode character, but you cannot do this since the headers must be in ASCII. To embed any non-ASCII characters in a header, you need to use a MIME Encoded-Word.

See mb_encode_mimeheader, read its examples.

The resulting header will need to look something like this:

Subject: =?utf-8?B?4p2k?=

Which decodes to this in the mail client:

Upvotes: 12

Related Questions