e-mails in HTML format

Why I can’t send emails in html?
I’m using mail()

Thanks!

Probably because you did not indicate Content-Type: text/html in the headers.

true!

Thanks friend! :D

Any chance I could see an example of how this is done?

http://us4.php.net/manual/en/function.mail.php

Here it is:
[php]
$email="[email protected]"; // Email recipient
$body="

        <h1> My HTML Message goes Here</h1>
";

mail("$email", “Email Subject”, “$body”, “Content-type: text/html;”);
echo “Message sent to $email”;
[/php]

Make sure you are using a more recent PHP release. I think anything over 4.3.3 will work, but 4.3.3 and below were giving me a LOT of funky dropped characters (I think in the bug list it said every 1024 chars.) If you are using HTML email, then you’ll have a lot of problems with tables and such. I just went up to 4.3.7 and the same code has no lost character problems - the email looks great.

Hm… I never had that problem…

Apparently it’s a Windows/HTML thing. I’m using Apache2 on a windows machine and it happened all the time - probably 2/3 of all my outgoing emails.

I have
IIS 5.1 and IIS 6.0 and no problems,

probably you have it because Apach is interfearing with some internal procecess and when email is sent it sending let say 5600FFx00 and other APP is using that derictive

Checkout:
http://bugs.php.net/bug.php?id=25333

ok…
maybe i didn’t have that because I was using MS Exchange 2000 (and now 2003)?

Thanks for this, but here’s a problem I’m having:

”.$AddLine1."

"

I need to get the ‘3’ into quotes. How do I do this?

Ok then use ASCII codes:

&quot;3&quot;

This will give you “3”

“=”

I tried this

"n".

and I got this in my final source

I think I’m missing something fundamental. Any ideas?

it seams that HTML Processor ignores the ASCII derectives within the tags… I can’t think of different solution, but there may be a way around.

Why do you need to use quotes? if only for a HTML tag you may ignore them or use single quote ( [’] instead of ["])

Sponsor our Newsletter | Privacy Policy | Terms of Service