|
Posted by DrTebi on 09/28/05 15:53
On Tue, 27 Sep 2005 22:52:30 -0400, Ben Jamieson wrote:
> Hi all,
>
> New here - arrived out of desperation....
>
> I have some basic code as follows:
>
> [code]
> ...
> $name=$details['name']//this coming from mysql query
> ....
> $subject="my subject";
> $body=<<<MESSAGE
> $name
>
> Thank you for blah blah blah
> MESSAGE;
>
> mail($toaddress,$subject,$body, "From: $admin_email");
> [/code]
>
> All very basic stuff, I've used it a million times.
>
> Now, in a bizarre turn of events, the message body ONLY shows the value
> of $name. Nothing below that comes through in the email.
>
> Even more bizarre - if I echo the contents of $body to the page,
> everything shows up fine. I have pasted this into my editor to check
> for stray characters, but there's nothing out of the ordinary.
>
> Does anyone have any clues as to what's happening - its driving me mad!
Hello,
what comes to mind is that you are not using end of line characters for
your extra headers (the "From: $admin_email").
A couple things to try, change the mail line to this:
mail($toaddress,$subject,$body, "From: $admin_email\n");
or this:
mail($toaddress,$subject,$body, "From: $admin_email\r\n");
or this:
mail($toaddress,$subject,$body, "From: $admin_email\r\n\r\n");
If that does still not work, try this:
mail($toaddress,$subject,$body);
This should fix it I hope, because as far as I know, there must
be an extra line break after all the header stuff.
DrTebi
Navigation:
[Reply to this message]
|