Jump to content

Recommended Posts

I've been sending emails from my program for a while using the following code to generate an html email header. This has been working fine - it's a company intranet application that has a couple of outside people who receive some emails. Travel agents to be specific. There haven't been any issues going on a year or so with this but now one of the travel agents switched to gmail for email and gmail isn't digging my code.

$random_hash = md5(date('r', time()));

//email contents follow
$body=
'
--PHP-alt-'. $random_hash.' 
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

You need to enable html email in order to receive the travel request in an email. You will need to check the application for the request. 

--PHP-alt-'.$random_hash.' 
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

<p>message text etc.</p>

Let me know if I need to post more code (if you think this is a problem with my html I'll gladly post more.)

Link to comment
https://forums.phpfreaks.com/topic/166710-gmail-mail-not-getting-my-html/
Share on other sites

...gmail isn't digging my code.

 

What does that mean, exactly? Based on the title of your post I "assume" it means that the user does not even receive the email, but I never like to assume. Or do they received the email but it only shows the plain text version? PLease be specific.

 

Assuming they do not receive the email, have you had the user check their "Spam" folder in Gmail? If it is marked as spam the user can configure Gmail to always allow those messages.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.