Qmail Issue

Hi im just wondering whats up with this - i am just doing a plain php mail function

[code]$to1 = ‘[email protected]’;
$to2 = ‘[email protected]’;

$subject = ‘Here is a Message’;

$headers = “From: [email protected]\r\n”;
$headers .= “Reply-To: [email protected]\r\n”;
$headers .= “MIME-Version: 1.0\r\n”;
$headers .= “Content-Type: text/html; charset=ISO-8859-1\r\n”;

$form_body = ‘’;
$form_body .= ‘

YES

’;
$form_body .= “”;

mail($to1, $subject, $form_body, $headers);
mail($to2, $subject, $form_body, $headers);[/code]

The issue is, with [email protected] it comes in plain text and [email protected] is formatted in html.
[email protected] (Hosted By Us)
[email protected] (Hosted By Another Company)

All i get with the plain html one is:

Content-Type: text/html; charset=ISO-8859-1

YES

I’ve seen this before a few times and each time the problem was \r\n.

Have a play around with placement - and try changing from \r\n to just \n.

First thing i’d do is remove it from the first headers email.
[php]
$headers = “From: [email protected]\r\n”;
// to this
$headers = “From: [email protected]”;
[/php]

Hope that helps,
Red :wink:

PS: Wiveliscombe is not to far from me, nice place :wink:

Ah thanks lol :slight_smile: was a bit strange as this is the same code i use on my other dedicated server - just didnt seem to work on this haha.

As a sidenote, programmers have been cursing over sending mail since, well, since i can remember.
Most (i know) prefer to use pre built classes from authors who’ve spent a long long time creating them - far longer than you or I would wish to spend, timewise - might i suggest you go for one of them.

There are many about and I was going to post links to them but that would be endorsing one over another so instead, here’s the google results for said classes.

Hope that helps,
Red :wink:

Wish i could get classes working - but inhertiance doesnt seem to work well for me in PHP… it works fine in C++ but i cant always get the variables passing through (maybe i should have spent longer on it haha.)

Sponsor our Newsletter | Privacy Policy | Terms of Service