3

I want to add image like company logo in email subject using php mail function i have added

$subject = "<img src=\"https://www.donndraper.com/images/logo.png\" width=\"50px\">"); 
$header = "From: $email\n Content-Type: text/HTML;";
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
Khalid
  • 49
  • 2
  • 4
    Have you EVER seen an image in an email subject? – Jerry Jun 13 '13 at 13:00
  • 1
    The OP is not totally crazy. Just got an email from AT&T that had this subject (show original, gmail) `Subject: =?UTF-8?B?VGFsay4gQ29ubmVjdC4gUmVsYXguIOKYug==?=` the result is a smiley at the end of the subject. On my iPhone it was a pretty yellow image smiley, but I think that's just the iPhone replacing a symbol with an image to make things look prettier. – Gus Jun 25 '13 at 19:11

3 Answers3

3

What JerrySeeger was trying to say, in a fairly condescending manner, is that e-mail does not support images in the subject.

The SMTP protocol was designed 20 years before HTML was even invented.

What you desire is simply not possible.

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
  • "The SMTP protocol was designed 20 years before HTML was even invented"--and yet HTML mail *bodies* are everywhere... – Matt Gibson Aug 21 '15 at 12:25
  • @MattGibson The issue is that no e-mail client that exists, has ever existed, or will ever exist, support rendering an image in the `Subject`. Which makes the answer to Khalid's question: *Not possible*. – Ian Boyd Aug 21 '15 at 22:31
2

You cannot include custom images (such as your company logo), however, there are a limited number of Unicode images that you can use in the header.

Some clients render them by using color images rather than treat them as characters in a font. The following article has a few images comparing how various mobile devices render them:

And you can see Wikipedia for a long list of the available characters, and if for some reason your font does not support those characters, the second link are bitmap renders of those characters:

IQAndreas
  • 8,060
  • 8
  • 39
  • 74
0

@GUS well said.. and you guys are all wrong.

You may use any unicode utf-8 or Base64 in mail subject and latest Trend in mass Mailers. its pretty easy to implement .