Solved

Outlook not reading all the headers HTML becomes Plain Text

Posted on 2008-06-25
10
1,054 Views
Last Modified: 2009-01-13
I have a php script that has always sent me html emails.  I just changed email servers and now the html is sent in plain text with part of the headers in the message.  The headers look like this:
From: admin@adminedit.net
Return-Path: admin@adminedit.net
Reply-To: admin@adminedit.net
MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1
X-Mailer: PHP/5.2.4

Whe I view the headers in outlook they stop at "Mine-Version: 1.0"
The email message then starts with:
Content-type: text/html; charset=iso-8859-1
X-Mailer: PHP/5.2.4

<h3 align="center">Order has been received
~~~~ rest of email taken out~~~~~

Why is this happening?  Any Ideas on how to fix.
0
Comment
Question by:mathius1
  • 6
  • 2
10 Comments
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 21873624
Can you make 100% sure that the line termination for MIME-Version: 1.0 is \r\n and not just \n or \r.

Can you show the code you are using to generate the email?
0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 21873654
Here is a set of my headers that Outlook 2003 shows for SMTP sourced email I generate.

I'm using PHP5 with htmlmimemail5 from phpguru.org as my mail class (rather than phpmailer simply because I came across this one first - nothing at all against phpmailer).

Ok, mine is quite complex with related and alternative entries as well as attachments.
0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 21873687
Here is a set of my headers that Outlook 2003 shows for SMTP sourced email I generate.

I'm using PHP5 with htmlmimemail5 from phpguru.org as my mail class (rather than phpmailer simply because I came across this one first - nothing at all against phpmailer).

Ok, mine is quite complex with related and alternative entries as well as attachments, but the header is controlled by the mail class.
Microsoft Mail Internet Headers Version 2.0
 
--=_c202533a651d46d8ffa17aa8578733d4--

Open in new window

0
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 

Author Comment

by:mathius1
ID: 21875096
The Headers are sent from PHP like this:

            $headers = 'From: support@neonwolfstudios.com' . "\r\n" .
                  'Return-Path: support@neonwolfstudios.com' . "\r\n" .
                  'Reply-To:support@neonwolfstudios.com' . "\r\n" .
                  'MIME-Version: 1.0' . "\r\n" .
                  'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
                  'X-Mailer: PHP/' . phpversion();

0
 

Author Comment

by:mathius1
ID: 21875213
I tried to switch the code around:

            $headers = 'From: support@neonwolfstudios.com' . "\r\n" .
                  'Return-Path: support@neonwolfstudios.com' . "\r\n" .
                  'Reply-To:support@neonwolfstudios.com' . "\r\n" .
                  'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
                  'MIME-Version: 1.0' . "\r\n" .
                  'X-Mailer: PHP/' . phpversion();

With this code it stops after the Content-type. It seems that it will only accept 4 header lines?
0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 21878377
What is the total length of the headers at that point?

What mailer are you using? PHP's built-in mail() command or a class?

I wonder if $headers has a limit of 128 (ish) characters.

Can you show more code? Especially on the creation of the mail() call.
0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 21926375
Anything else on this?
0
 
LVL 40

Accepted Solution

by:
Richard Quadling earned 125 total points
ID: 21926409
Oh. Here are the headers I promised.
Microsoft Mail Internet Headers Version 2.0
Received: from localhost ([10.0.0.18]) by mailgate.xxxx.co.uk with Microsoft SMTPSVC(6.0.3790.3959);
	 Thu, 3 Jul 2008 05:17:24 +0100
MIME-Version: 1.0
X-Mailer: htmlMimeMail5 <http://www.phpguru.org/>
From: "xxxx Tyre Contracts Rescue" <TCR@xxxx.co.uk>
Return-Path: "xxxx Tyre Contracts Rescue" <TCR@xxxx.co.uk>
Return-Receipt-To: "xxxx Tyre Contracts Rescue" <TCR@xxxx.co.uk>
Disposition-Notification-To: "xxxx Tyre Contracts Rescue" <TCR@xxxx.co.uk>
Subject: CUSTOMER Tyre Support (Manchester) - Tyre Order Number Request for Jobsheet : 11431658 
Cc: "Ryan" <Ryan@xxxx.co.uk>
Content-Type: multipart/mixed;
	boundary="=_65141eeb1569d827165fdc0884c2ed26"
Message-ID: <k3ex90.5u@localhost>
To: "Annika" <Annika@Customer.co.uk>
X-OriginalArrivalTime: 03 Jul 2008 04:17:24.0998 (UTC) FILETIME=[B2686A60:01C8DCC3]
Date: 3 Jul 2008 05:17:24 +0100
 
--=_65141eeb1569d827165fdc0884c2ed26
Content-Type: multipart/related;
	boundary="=_ec55e734998cde7c22b852f6162bde42"
 
--=_ec55e734998cde7c22b852f6162bde42
Content-Type: multipart/alternative;
	boundary="=_713d11a8c8a0c3e6d0d118ba7b7f2847"
 
--=_713d11a8c8a0c3e6d0d118ba7b7f2847
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
 
--=_713d11a8c8a0c3e6d0d118ba7b7f2847
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 
 
--=_713d11a8c8a0c3e6d0d118ba7b7f2847--
--=_ec55e734998cde7c22b852f6162bde42
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="Logo_HillHire.gif"
Content-ID: <708fdc7e8f0ed74b7d7f09d5c31da748>
 
 
--=_ec55e734998cde7c22b852f6162bde42--
--=_65141eeb1569d827165fdc0884c2ed26
Content-Type: application/pdf
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="11431658.pdf"
 
--=_65141eeb1569d827165fdc0884c2ed26
Content-Type: image/tiff
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="11431658.tif"
 
 
--=_65141eeb1569d827165fdc0884c2ed26--

Open in new window

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
wordpress on root is limiting my .htaccess 404.php options 4 30
php checkbox validation 5 27
two ways encryption with php 3 28
Number of hours between date in DB and now 8 18
This article discusses how to create an extensible mechanism for linked drop downs.
Find out what Office 365 Transport Rules are, how they work and their limitations managing Office 365 signatures.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question