Jump to content

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) "admin@runningprofiles.com" ["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 = 'admin@runningprofiles.com';
$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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.