0

I've been using php to send html emails to people daily for over a year and it has always worked until today, all the emails sent to gmail accounts just displayed the html code. I haven't changed any code recently. It always just displays the html code now in gmail instead of showing the hyperlinks and images.

Here's what it shows:

Reply-To: updates@mysite.com

MIME-Version: 1.0

Content-type: text/html; charset=UTF-8

X-Mailer: PHP/5.3.2 Message-Id: <20120426030303.E8B03A295@www1.mysite.com> Date: Wed, 25 Apr 2012 20:03:03 -0700 (PDT)

... etc.

What happened? Did google change something?

Thomas
  • 1,445
  • 14
  • 30
Curtis
  • 2,486
  • 5
  • 40
  • 44

2 Answers2

3

This has also started happening for me since yesterday: 25/04/2012. I have been receiving the same email, same format daily for the last few years - and yesterday seized to stop displaying in HTML format!

Comparing the message content - only thing different I can see from a previous email that displayed correctly is the addition after the authentication results of the following:

Date: Wed, 25 Apr 2012 17:31:23 -0700 (PDT) Message-Id: <4f98975b.9cecd80a.7d2a.66b3SMTPIN_ADDED@mx.google.com>

Could this have anything to do with the cause?

Scrap the above - take a look at this stie: http://johndoesdesign.com/blog/2012/php/getting-your-php-html-email-to-render-in-gmail/

It appears the cause is the "\r\n" - use just "\n" instead. Why this would just start happening out of the blue - something must have changed gmail's end. I've tried this and solved the issue for me. Hope it does for you.

Thomas
  • 1,445
  • 14
  • 30
ltrivett
  • 46
  • 2
1

I hope this could help u

Send email using the GMail SMTP server from a PHP page

and like Lawrence said, accept your questions so ppl could answer faster and better

Community
  • 1
  • 1
Eduardo Iglesias
  • 1,056
  • 18
  • 42
  • 1
    I'm not using any libraries, just using the mail() command and I would like to keep doing it that way if that's still possible to send html emails to gmail accounts that way. It isn't giving an error. – Curtis Apr 26 '12 at 05:09
  • 2
    Hooray for spending time writing code to solve problems that other people have already solved! No, wait. Not hooray. – Quentin Apr 26 '12 at 09:32