I do not get any returns to my email. I know this sounds funny but i want the email that is not correct to come back to me so i can delete the users. this is my code what have i done wrong? <? $subd = ""; require_once $subd . "../../includes/sv_config.php"; require_once $subd . "../../includes/db_connect.php"; $connector = new DbConnector(); $todaydate=date("d"); $todaymonth=date("m"); $todayyear=date("Y"); $today="$todayyear-$todaymonth-$todaydate"; $mktod=mktime(0, 0, 0, $todaymonth, $todaydate, $todayyear); //$mktoday=mktime(0, 0, 0, $todaymonth, $todaydate, $todayyear); $mktoday=mktime(0, 0, 0, $todaymonth, $todaydate-2, $todayyear); //echo "$today - $mktod<p>"; //echo "$today - $mktoday<p>"; $sql="select * from frm_users where login_time='00:00:00' order by userid"; $res=mysql_query($sql); while ($row=mysql_fetch_array($res)) { $id=$row["userid"]; $email=$row["email"]; $joindate=$row["joindate"]; $jdchkdate=substr($joindate, 8, 2); $jdchkmonth=substr($joindate, 5, 2); $jdchkyear=substr($joindate, 0, 4); $jdchk="$jdchkyear-$jdchkmonth-$jdchkdate"; $mkjdchk=mktime(0, 0, 0, $jdchkmonth, $jdchkdate, $jdchkyear); echo "$id - $email - $joindate<p>"; echo "$today - $mktoday : $joindate - $mkjdchk<p>"; if($mkjdchk==$mktoday) { $sender_email="support@domainsample.com"; $subject = "Have you forgotten your membership?"; /* To send HTML mail, you can set the Content-type header. */ $headers = "MIME-Version: 1.0\r\n"; $headers .= "From: domainsample.com <$sender_email>\n"; $headers .= "X-Sender: <$sender_email>\n"; $headers .= "X-Mailer: e-kort.se\r\n"; $headers .= "X-MSMail-Priority: High\r\n"; $headers .= "X-Priority: 4\r\n"; //1 UrgentMessage, 3 Normal $headers .= "Return-Path: <$sender_email>\n"; //Uncomment this to send html format $boundary = uniqid("domainsample.com"); $headers .= "Content-Type: multipart/alternative" . "; boundary = $boundary\r\n\r\n"; $headers .= "This is a MIME encoded message.\r\n\r\n"; $headers .= "--$boundary\r\n" . "Content-Type: text/html; charset=tis-620\r\n"; $message = "Hello!<p> It has been a few days now since you signed up @<p> <a href='http://www.domainsample.com/picture/index.php?cmd=4' target='_blank'>www.domainsample.com</a><p> You need to enter your validation code to be able to use our community fully.<p> If you lost your password / activation code you can get a new one here<p> <a href='http://www.domainsample.com/login.php?page=password' target='_blank'>http://www.domainsample.com/login.php?page=password</a><p> We hope to see you soon.<p> The Support team<p>"; mail($email, $subject, $message, $headers); //echo "Done"; } } ?> PHP:
No thats ok i know whats thats for. I am looking for the problem why emails never return to me if they are wrong. If i send 100 emails i a day at least one should be wrong but it is not.
It doesn't matter anyway... PHP mail function doesn't handle returns as the return happens long, long after the PHP script has finished. You're going to need a script that reads an inbox and does some fancy parsing itself, but I can guarantee you that mail(...) won't help in that.
no no i would like to get the emails to the same email i am sending from. In other script i get that but there i get none.
Well, I guess there's a couple of things that could be the problem. Firstly, it could be the fact that *no* emails are actually getting sent: that's what krakjoe is working on the assumption of (I assume): so just to see, add an echo after the if comparison that he quoted there. Secondly, it could just be that there are *no* incorrect email addresses, right? Unless, of course, you know for sure that that is not the case.