Jump to content

[SOLVED] emails arn't sending?


runnerjp

Recommended Posts

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

 

<?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";
        }
}

//set emailed to 'y' so that they don't get numerous emails... set it back to 'n' when they view this topic
$query_noted = "UPDATE forum_email SET mailed='0' WHERE topic_id = '".$forumtopicid."'";?>

 

but my emails are not been sent and $query_noted is'nt updating the mailed field...

 

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) "[email protected]" ["ID"]=>  string(1) "1" }

 

so its getting the data ... any 1 figure out why

Link to comment
https://forums.phpfreaks.com/topic/132928-solved-emails-arnt-sending/
Share on other sites

changed ti to

		<?php $query = "SELECT fe.*, u.email, u.ID FROM forum_email as fe INNER JOIN users as u ON u.ID = fe.user_id";
	$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 = '[email protected]';
$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";
        }
}?>

 

didnt work sadly

As the manual states:

It is important to note that just because the mail was accepted for delivery, it does NOT mean the mail will actually reach the intended destination.

 

Sorry, but I really don't know. Perhaps the e-mail is wrong. Perhaps you should wait a bit longer. Check your junk. Try a different e-mail address. ???

Perhaps the e-mail is wrong. -- thought that at 1st and its correct

 

Perhaps you should wait a bit longer.  -- i did it yesterday lol

 

Check your junk.-- empty

 

Try a different e-mail address. /-- yup done and no success lol

 

 

thanks for trying.... any1 else know?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.