Form Email Results Arrive as "Nobody" how can I change to an Email Address?

I have a custom PHP form script and when I receive results by Email they arrive as "Nobody" and I would to know how can I edit this?

I have tried a couple of additional lines but it didn't work.

Thank you.
//send the mail...
	
	$enviarEmail = array("myemail@domain.com");
while (list($key,$email) = each($enviarEmail)){
   mail($email,"My Title", $productos, $textF);
 
	}
    //thanks 
    echo " <table width=660 border=0 align=center cellpadding=0 cellspacing=0>";
    echo " <tr>";
    echo " <td width=458><span class=style3>Thank you msg</span><br/>
    </td>";
    echo "</tr> ";
    echo "</table>";
   echo "	<form method='post'><input type='button' value='Close Window'onclick='window.close()'></form>";

Open in new window

ametradeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hieloCommented:
You need  to provide a "From:" header
$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: John Doe <webmaster@example.com>';
 
mail($to, $subject, $message, $headers);

Open in new window

0
ametradeAuthor Commented:
Hello Hielo, I tried  adding only $headers = 'From: John Doe <webmaster@example.com>'; but it didn't work in my code :(
0
hieloCommented:
Try this:
$enviarEmail = array("myemail@domain.com");
$to      = '';
$subject = 'My Title';
$message = $productos;
$headers = 'From: John Doe <webmaster@example.com>';
 
 
while (list($key,$email) = each($enviarEmail))
{
	$to = $email;
	//mail($email,"My Title", $productos, $textF);
	mail($to, $subject, $message, $headers); 
}

Open in new window

0
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

ametradeAuthor Commented:
Ok, almost done, at least email is arriving with "John Doe"

textF is OK but I also need to receive what is in $products

I tried to add it but then it won't work

thx again
$enviarEmail = array("xxxxxx");
$to      = 'xxxxx';
$subject = 'My Title';
$message = $textF;
$headers = 'From: John Doe <webmaster@example.com>';
 
 
while (list($key,$email) = each($enviarEmail))
{
        $to = $email;
        //mail($email,"My Title", $productos, $textF);
        mail($to, $subject, $message, $headers); 
}

Open in new window

0
hieloCommented:
I don't know what you have in $textF, but if I had to guess you need either this:
$message = $textF . "\n\n".$products;

or this:
$message = $products."\n\n".$textF;


Instead of just:
$message = $textF;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ametradeAuthor Commented:
THANK YOU, great support.
0
hieloCommented:
>> great support
Please, use the word "help", not "support". Support implies that I work for Experts Exchange and I am an employee doing its job. I don't get a single penny for Helping others.
0
ametradeAuthor Commented:
sorry didn't know that, thanks for your help.
0
ametradeAuthor Commented:
sorry didn't know that, thanks for your help.
0
hieloCommented:
Not a problem. You are welcome!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.