Problems sending HTML emails
Moderator: General Moderators
Problems sending HTML emails
Hi All,
I've just copied a newsletter script I've been running for a while from my previous host to a new host and ran into a problem.
Emails are being received as texts rather than HTML, (didn't have this problem on my previous host), I dont if the problem is related toi the fact that my new host adds some text to the email itself .. Here's what I receive in my inbox :
Content-Type: text/html
Message-Id: <E1DD3Jq-0006bs-00@venus.webfusion.co.uk>
Date: Sun, 20 Mar 2005 16:30:26 +0000
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head>
<body>
Newsletter
<img src="http://stopandshop.me.uk/news/images/test.jpg" width="120" height="200" />
</body>
</html>
Message-ID and Date appear because the host seems to be writing this to every email.
Is there any way to force the email to be a html email?
Kind Regards
Musaffar
http://www.good2shop.co.uk
I've just copied a newsletter script I've been running for a while from my previous host to a new host and ran into a problem.
Emails are being received as texts rather than HTML, (didn't have this problem on my previous host), I dont if the problem is related toi the fact that my new host adds some text to the email itself .. Here's what I receive in my inbox :
Content-Type: text/html
Message-Id: <E1DD3Jq-0006bs-00@venus.webfusion.co.uk>
Date: Sun, 20 Mar 2005 16:30:26 +0000
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head>
<body>
Newsletter
<img src="http://stopandshop.me.uk/news/images/test.jpg" width="120" height="200" />
</body>
</html>
Message-ID and Date appear because the host seems to be writing this to every email.
Is there any way to force the email to be a html email?
Kind Regards
Musaffar
http://www.good2shop.co.uk
Last edited by mzfp2 on Sun Mar 20, 2005 10:36 am, edited 1 time in total.
The code is as follows
However I doubt it has much to do with the code, as this code worked perfectly on my previous host.
Kind Regards
Musaffar
http://www.good2shop.co.uk
Code: Select all
$subject = 'Stop&Shop Nesletter';
$message = ParseTemplate($template, $ent);
$to = $row[email];
$xtra = "From: info@stopandshop.me.uk (StopAndShop)\r\n";
$xtra .= "Content-Type: text/html \r\n";
$mail_result = @mail($to, $subject, $message, $xtra);However I doubt it has much to do with the code, as this code worked perfectly on my previous host.
Kind Regards
Musaffar
http://www.good2shop.co.uk
Last edited by mzfp2 on Sun Mar 20, 2005 10:39 am, edited 1 time in total.
I've removed the from the header data in both lines, now i get the following text in my email
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head>
<body>
Newsletter
<img src="http://stopandshop.me.uk/news/images/test.jpg" width="120" height="200" />
</body>
</html>
But not displaying as HTML
Code: Select all
\r\n<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head>
<body>
Newsletter
<img src="http://stopandshop.me.uk/news/images/test.jpg" width="120" height="200" />
</body>
</html>
But not displaying as HTML
Headers are
Return-Path: <stopshop@venus.webfusion.co.uk>
Delivered-To: admin@alljammin.com
Received: (qmail 29072 invoked from network); 20 Mar 2005 16:36:27 -0000
Received: from venus.webfusion.co.uk (212.67.202.12)
by 0 with SMTP; 20 Mar 2005 16:36:27 -0000
Received: from stopshop by venus.webfusion.co.uk with local (Exim 3.36 #1)
id 1DD3PX-0006wY-00
for admin@alljammin.com; Sun, 20 Mar 2005 16:36:19 +0000
To: admin@alljammin.com
Subject: Stop&Shop Nesletter
From: info@stopandshop.me.uk (StopAndShop)
email code is :
Content-Type: text/html
Message-Id: <E1DD3PX-0006wY-00@venus.webfusion.co.uk>
Date: Sun, 20 Mar 2005 16:36:19 +0000
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
Newsletter
<img src="http://stopandshop.me.uk/news/images/test.jpg" width="120" height="200" />
</body>
</html>
Obtained this from Outlook. Hope it helps
Return-Path: <stopshop@venus.webfusion.co.uk>
Delivered-To: admin@alljammin.com
Received: (qmail 29072 invoked from network); 20 Mar 2005 16:36:27 -0000
Received: from venus.webfusion.co.uk (212.67.202.12)
by 0 with SMTP; 20 Mar 2005 16:36:27 -0000
Received: from stopshop by venus.webfusion.co.uk with local (Exim 3.36 #1)
id 1DD3PX-0006wY-00
for admin@alljammin.com; Sun, 20 Mar 2005 16:36:19 +0000
To: admin@alljammin.com
Subject: Stop&Shop Nesletter
From: info@stopandshop.me.uk (StopAndShop)
email code is :
Content-Type: text/html
Message-Id: <E1DD3PX-0006wY-00@venus.webfusion.co.uk>
Date: Sun, 20 Mar 2005 16:36:19 +0000
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
Newsletter
<img src="http://stopandshop.me.uk/news/images/test.jpg" width="120" height="200" />
</body>
</html>
Obtained this from Outlook. Hope it helps