emails aint sending

ok i have my code below that checks to see if a user wants to recive emails about new posts on a topic...
but my emails are not been sent

i var_dunm($row) and got

 array(5) { ["user_id"]=>  string(1) "1" ["topic_id"]=>  string(3) "484" ["mailed"]=>  string(1) "1" ["email"]=>  string(25) "admin@runningprofiles.com" ["ID"]=>  string(1) "1" }

so its getting the data ... any 1 figure out why the emails aint been sent to me
<?php $query = "SELECT fe.*, u.email, u.ID FROM forum_email as fe INNER JOIN users as u ON u.ID = fe.user_id WHERE fe.topic_id = " . $forumpostid . "  AND fe.mailed=1";
$res = mysql_query($query) or die ("$query fails : ".mysql_error());
//$row = mysql_fetch_assoc($res);
//var_dump($row);
//echo $forumpostid; echo $id;
//nobody wants an email, stop now
if(mysql_num_rows($res)==0)
{
 echo "no records returned";
        exit;
}
 
// ADDED CODE TO SEND EMAIL MESSAGES
$subj = 'Forum Updated';
$from = ' [your return information ] ';
$text = ' [your message text] ';
 
while ($row = mysql_fetch_assoc($res)) {
        extract ($row);
        if (!mail($email, $subj, $text, $from)) {
                echo "<br />MAIL FAILED FOR $email \n";
        }
}

Open in new window

runnerjpAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

Roger BaklundCommented:
What is in the $from variable? This is used as mail headers, and must be formatted correctly.

http://php.net/manual/en/function.mail.php
0
Ray PaseurCommented:
@runerjp: Isn't this what we are talking about in another thread? ~Ray

Try changing the mail command to OMIT the from field, like this on line 20.
        if (!mail($email, $subj, $text)) {

Open in new window

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
Ray PaseurCommented:
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.