Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PHP] HTML email with Outlook

0 views
Skip to first unread message

Jim Lucas

unread,
Jul 15, 2003, 6:54:26 PM7/15/03
to php-g...@lists.php.net, Tim Thorburn
I would take a look at the headers of an email that does render html
correctly in outlook and see what you are missing.

Trial and error.

Jim Lucas

----- Original Message -----
From: "Tim Thorburn" <immo...@nwconx.net>
To: <php-g...@lists.php.net>
Sent: Tuesday, July 15, 2003 3:48 PM
Subject: [PHP] HTML email with Outlook


> Hi,
>
> I've made a PHP script that sends out an automatic email through my
servers
> cron system, it works well, but I thought I'd try to do some HTML email to
> get things to line up a little better.
>
> To do so, I added the following line in my mail() command: -Type:
> text/html; charset=iso-8859-1
>
> When I check the messages sent out with Eudora, the HTML email comes in
> perfectly. However, when I check with Outlook Express 6 - I get the
actual
> HTML code rather than the nicely formatted email that I had created.
>
> Should I be using another line in my mail() command? I've recieved HTML
> email before with Outlook Express on my machine without changing any
> settings at all. Also, I had sent an email from my script to hotmail and
> the HTML email worked fine there too.
>
> Any thoughts?
>
> Thanks
> -Tim
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Tim Thorburn

unread,
Jul 15, 2003, 6:48:03 PM7/15/03
to php-g...@lists.php.net

Baroiller Pierre-Emmanuel

unread,
Jul 15, 2003, 6:56:00 PM7/15/03
to php-g...@lists.php.net
Hi,
try with adding this :
$header = "Content-Type: text/html;
charset=\"iso-8859-1\"\nContent-Transfer-Encoding: 8bit\n\n";

If it don't work, try to build multipart email ...

Regards,
P.E. Baroiller

"Tim Thorburn" <immo...@nwconx.net> a écrit dans le message de
news:5.2.1.1.0.200307...@mail.nwconx.net...

Johnny Martinez

unread,
Jul 15, 2003, 6:56:20 PM7/15/03
to Tim Thorburn, php-g...@lists.php.net
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

Does this help?

Johnny

-----Original Message-----
From: Tim Thorburn [mailto:immo...@nwconx.net]
Sent: Tuesday, July 15, 2003 3:48 PM
To: php-g...@lists.php.net
Subject: [PHP] HTML email with Outlook


Hi,

I've made a PHP script that sends out an automatic email through my servers
cron system, it works well, but I thought I'd try to do some HTML email to
get things to line up a little better.

To do so, I added the following line in my mail() command: -Type:
text/html; charset=iso-8859-1

When I check the messages sent out with Eudora, the HTML email comes in
perfectly. However, when I check with Outlook Express 6 - I get the actual
HTML code rather than the nicely formatted email that I had created.

Should I be using another line in my mail() command? I've recieved HTML
email before with Outlook Express on my machine without changing any
settings at all. Also, I had sent an email from my script to hotmail and
the HTML email worked fine there too.

Any thoughts?

Thanks
-Tim

--

Johnny Martinez

unread,
Jul 15, 2003, 7:20:41 PM7/15/03
to Curt Zirzow, php-g...@lists.php.net
"Remember not all email clients support email."

Did I read that right or is it a typo?

J

-----Original Message-----
From: Curt Zirzow [mailto:cu...@zirzow.dyndns.org]
Sent: Tuesday, July 15, 2003 4:17 PM
To: php-g...@lists.php.net
Subject: Re: [PHP] HTML email with Outlook


Tim Thorburn <immo...@nwconx.net> wrote:
> Hi,
>
> I've made a PHP script that sends out an automatic email through my
servers
> cron system, it works well, but I thought I'd try to do some HTML email to

> get things to line up a little better.
>
> To do so, I added the following line in my mail() command: -Type:
> text/html; charset=iso-8859-1
> When I check the messages sent out with Eudora, the HTML email comes in
> perfectly. However, when I check with Outlook Express 6 - I get the
actual
> HTML code rather than the nicely formatted email that I had created.
>
> Should I be using another line in my mail() command? I've recieved HTML
> email before with Outlook Express on my machine without changing any
> settings at all. Also, I had sent an email from my script to hotmail and
> the HTML email worked fine there too.

there are different ways to send html in an email and also very wrong
ways to send html in an email; very debatable topic from what I've seen.
I think your best bet is to use something like:

http://phpmailer.sourceforge.net/

You can send both plain/text and html. Remember not all email clients
support email. And a lot of people dont like it at all.

Of course if this is only for you to see I guess you can ignore all that
i said :)

Curt
--

Curt Zirzow

unread,
Jul 15, 2003, 7:17:17 PM7/15/03
to php-g...@lists.php.net

there are different ways to send html in an email and also very wrong

Mike Brum

unread,
Jul 15, 2003, 7:28:00 PM7/15/03
to Johnny Martinez, Curt Zirzow, php-g...@lists.php.net
By the context, I'm sure it should read "...not all email clients
support HTML."

(I got a laugh out of it though ;)

Manuel Lemos

unread,
Jul 15, 2003, 8:01:45 PM7/15/03
to Tim Thorburn, php-g...@lists.php.net
Hello,

That looks like one of the bugs of the mail() function that never got
fixed. In that case you may want to try this class that has built-in
workarounds for some of the mail() function bugs.

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Tim Thorburn

unread,
Jul 15, 2003, 9:31:44 PM7/15/03
to php-g...@lists.php.net
Thanks to all those who responded, as always, spelling is key. Where I had
-Type: text/html ... it should have read Content-Type : text/html ...

So it works for now, and hopefully will continue to. I know that there are
a number of email programs out there that do not support HTML mail, as well
I know there are a great many of individuals who do not enjoy it
either. We're just running a trial base here to see what works, if it
turns out that the majority of our customers do not enjoy it, then we'll
switch to plain text (actually built the plain-text one first, this is just
an add-on)


0 new messages