Forum Moderators: coopster

Message Too Old, No Replies

cron is not sending valid html email

html code is displayed in email body instead

         

phparion

1:14 pm on Jun 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi

I have a cronjob running on server. On its completion it sends out a HTML email. The same script works fine on other servers, only on this server I get html code instead of formatted html email like below,
-----------------------------------------------
Content-Type: text/html; charset=ISO-8859-1

Return-Path: root@example.com
X-OriginalArrivalTime: 12 Jun 2008 09:52:03.0382 (UTC) FILETIME=[F761ED60:01C8CC71]

Mr <strong>name</strong><br ><br > it is to be notified that <span>some example text here</span> and so on...
--------------------------------
How can I get rid of this so that it sends properly formatted html emails?

thank you

eelixduppy

3:01 pm on Jun 12, 2008 (gmt 0)



Do your headers show up as plain text, as well? Check your headers. And although it works fine on other servers, if you were to run this script directly on this server from the command line does it still not work?

phparion

4:15 pm on Jun 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



here is my header code

//add From: header
$headers = "From: auto@example.com\r\n";

//specify MIME version 1.0
$headers .= "MIME-Version: 1.0\r\n";

//HTML version of message
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

from CLI, it gives same problem. HTML code is sent instead of html formatted email.

Demaestro

4:20 pm on Jun 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Have you seen this effect across multiple accounts viewed in different email clients? It could just be your email client doesn't want to display HTML... try sending it to a couple different accounts and see if different clients will show it in HTML.

phparion

4:48 pm on Jun 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I am getting it on Gmail, I get the same from many servers on same Gmail ID. They display good from other servers only this server sends out html code.