Page 1 of 1

when sending mail where do you put from info

Posted: Mon Dec 01, 2003 4:49 pm
by mccommunity
Here is my mail tag:

mail($to, $subject, $message, $headers);


I thought the from went after headers but I tried it and it keeps showing up from Nobody. Where do I put this?


Mark

Posted: Mon Dec 01, 2003 4:52 pm
by mrvanjohnson
Can you send a clip of the code where you are creating and sending the email including where you define $to.. Everything here looks good.

You can also try manually adding a $to variable to see if that is where the problem is .. Change your code to

Code: Select all

<?php
mail("Test@email.com", $subject, $message, $headers);
?>

Posted: Mon Dec 01, 2003 4:52 pm
by microthick
You add it to your headers.

$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";

etc etc.