when sending mail where do you put from info

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mccommunity
Forum Commoner
Posts: 62
Joined: Mon Oct 07, 2002 8:55 am

when sending mail where do you put from info

Post 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
User avatar
mrvanjohnson
Forum Contributor
Posts: 137
Joined: Wed May 28, 2003 11:38 am
Location: San Diego, CA

Post 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);
?>
Last edited by mrvanjohnson on Mon Dec 01, 2003 4:54 pm, edited 1 time in total.
microthick
Forum Regular
Posts: 543
Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC

Post by microthick »

You add it to your headers.

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

etc etc.
Post Reply