haz Posted February 21, 2008 Share Posted February 21, 2008 Hi I had a tell a friend page on my site and it used to send emails to whoever friends you want but it wasn't sending the corresponding job ID. I fixed that but now it doesn't send emails anymore at all. Also there is a message at the top of the page " No recipient addresses found in header X-Powered-By: PHP/5.2.3-20070601 Content-type: text/html Thank you for letting know your friends about the site. " Go to this page first: http://trans-united.net/searchforcareer.php Select any job from the list then go to the bottom of the page that opens up for the job you selected and click "Tell A Friend" Fill out your info for the friend and your info and hit submit. You won't get an email. I need to fix this. I have this code but I don't know if it should go before the form code or in the header of the page or before the <html>?? -------------------------- <?php $id=$_GET["id"]; $subject="Hi Friend";$headers="From: ".$name."<".$email.">\r\n";$headers.="MIME-Version: 1.0\r\n";$headers.="Content-Type: text/plain; charset=\"iso-8859-1\"\r\n";$headers.= "X-Priority: 1\r\n";$headers.= "X-Mailer: PHP" . phpversion()."\r\n";$name=$_POST["name"];$email=$_POST["email"];$toname=$_POST["name1"];$toemail=$_POST["email1"].",";$message=$name. " refered you following page to browse.http://www.Trans-united.net/jobdetails.php?id=$id Moreover, ".$name." included following message for you.";$message.=$_POST["message"];//$success=mail($toemail,$subject,$message,$headers); if(isset($_POST["email2"]))//$success.=mail($_POST["email2"],$subject,$message,$headers); mail($_POST["email2"],$subject,$message,$headers);//$toemail.=$_POST["email2"].","; if(isset($_POST["email3"]))//$success.=mail($_POST["email3"],$subject,$message,$headers); mail($_POST["email3"],$subject,$message,$headers);//$toemail.=$_POST["email3"].","; if(isset($_POST["email4"])) mail($_POST["email4"],$subject,$message,$headers);//$success.=mail($_POST["email4"],$subject,$message,$headers);//$toemail.=$_POST["email4"].","; if(isset($_POST["email5"])) mail($_POST["email5"],$subject,$message,$headers);//$success.=mail($_POST["email5"],$subject,$message,$headers);//$toemail.=$_POST["email5"].","; if(isset($_POST["email6"])) mail($_POST["email6"],$subject,$message,$headers);//$success.=mail($_POST["email6"],$subject,$message,$headers);//$toemail.=$_POST["email6"].","; if(isset($_POST["email7"])) mail($_POST["email7"],$subject,$message,$headers);//$success.=mail($_POST["email7"],$subject,$message,$headers);//$toemail.=$_POST["email7"].",";//$headers .= 'CC: [email protected]' . "\r\n";// $headers .= 'Bcc: [email protected]' . "\r\n"; $success=mail($toemail,$subject,$message,$headers); if($success) echo "Thank you for letting know your friends about the site.";else{echo "Mail couldn't be send.";} ?> ---------- thanks Haz Link to comment https://forums.phpfreaks.com/topic/92310-tell-a-friend-page-no-longer-sends-email/ Share on other sites More sharing options...
aebstract Posted February 21, 2008 Share Posted February 21, 2008 First thing you need to do when posting code here, is put your code in [ code ] tags (no spaces): <?php $id=$_GET["id"]; $subject="Hi Friend";$headers="From: ".$name."<".$email.">\r\n";$headers.="MIME-Version: 1.0\r\n";$headers.="Content-Type: text/plain; charset=\"iso-8859-1\"\r\n";$headers.= "X-Priority: 1\r\n";$headers.= "X-Mailer: PHP" . phpversion()."\r\n";$name=$_POST["name"];$email=$_POST["email"];$toname=$_POST["name1"];$toemail=$_POST["email1"].",";$message=$name. " refered you following page to browse.http://www.Trans-united.net/jobdetails.php?id=$id Moreover, ".$name." included following message for you.";$message.=$_POST["message"];//$success=mail($toemail,$subject,$message,$headers); if(isset($_POST["email2"]))//$success.=mail($_POST["email2"],$subject,$message,$headers); mail($_POST["email2"],$subject,$message,$headers);//$toemail.=$_POST["email2"].","; if(isset($_POST["email3"]))//$success.=mail($_POST["email3"],$subject,$message,$headers); mail($_POST["email3"],$subject,$message,$headers);//$toemail.=$_POST["email3"].","; if(isset($_POST["email4"])) mail($_POST["email4"],$subject,$message,$headers);//$success.=mail($_POST["email4"],$subject,$message,$headers);//$toemail.=$_POST["email4"].","; if(isset($_POST["email5"])) mail($_POST["email5"],$subject,$message,$headers);//$success.=mail($_POST["email5"],$subject,$message,$headers);//$toemail.=$_POST["email5"].","; if(isset($_POST["email6"])) mail($_POST["email6"],$subject,$message,$headers);//$success.=mail($_POST["email6"],$subject,$message,$headers);//$toemail.=$_POST["email6"].","; if(isset($_POST["email7"])) mail($_POST["email7"],$subject,$message,$headers);//$success.=mail($_POST["email7"],$subject,$message,$headers);//$toemail.=$_POST["email7"].",";//$headers .= 'CC: [email protected]' . "\r\n";// $headers .= 'Bcc: [email protected]' . "\r\n"; $success=mail($toemail,$subject,$message,$headers); if($success) echo "Thank you for letting know your friends about the site.";else{echo "Mail couldn't be send.";} ?> Link to comment https://forums.phpfreaks.com/topic/92310-tell-a-friend-page-no-longer-sends-email/#findComment-473028 Share on other sites More sharing options...
haz Posted February 21, 2008 Author Share Posted February 21, 2008 <?php $id=$_GET["id"]; $subject="Hi Friend";$headers="From: ".$name."<".$email.">\r\n";$headers.="MIME-Version: 1.0\r\n";$headers.="Content-Type: text/plain; charset=\"iso-8859-1\"\r\n";$headers.= "X-Priority: 1\r\n";$headers.= "X-Mailer: PHP" . phpversion()."\r\n";$name=$_POST["name"];$email=$_POST["email"];$toname=$_POST["name1"];$toemail=$_POST["email1"].",";$message=$name. " refered you following page to browse.http://www.Trans-united.net/jobdetails.php?id=$id Moreover, ".$name." included following message for you.";$message.=$_POST["message"];//$success=mail($toemail,$subject,$message,$headers); if(isset($_POST["email2"]))//$success.=mail($_POST["email2"],$subject,$message,$headers); mail($_POST["email2"],$subject,$message,$headers);//$toemail.=$_POST["email2"].","; if(isset($_POST["email3"]))//$success.=mail($_POST["email3"],$subject,$message,$headers); mail($_POST["email3"],$subject,$message,$headers);//$toemail.=$_POST["email3"].","; if(isset($_POST["email4"])) mail($_POST["email4"],$subject,$message,$headers);//$success.=mail($_POST["email4"],$subject,$message,$headers);//$toemail.=$_POST["email4"].","; if(isset($_POST["email5"])) mail($_POST["email5"],$subject,$message,$headers);//$success.=mail($_POST["email5"],$subject,$message,$headers);//$toemail.=$_POST["email5"].","; if(isset($_POST["email6"])) mail($_POST["email6"],$subject,$message,$headers);//$success.=mail($_POST["email6"],$subject,$message,$headers);//$toemail.=$_POST["email6"].","; if(isset($_POST["email7"])) mail($_POST["email7"],$subject,$message,$headers);//$success.=mail($_POST["email7"],$subject,$message,$headers);//$toemail.=$_POST["email7"].",";//$headers .= 'CC: [email protected]' . "\r\n";// $headers .= 'Bcc: [email protected]' . "\r\n"; $success=mail($toemail,$subject,$message,$headers); if($success) echo "Thank you for letting know your friends about the site.";else{echo "Mail couldn't be send.";} ?> Better? Link to comment https://forums.phpfreaks.com/topic/92310-tell-a-friend-page-no-longer-sends-email/#findComment-473041 Share on other sites More sharing options...
haz Posted February 22, 2008 Author Share Posted February 22, 2008 does anyone wish to help? Link to comment https://forums.phpfreaks.com/topic/92310-tell-a-friend-page-no-longer-sends-email/#findComment-473710 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.