Jump to content

Tell a Friend page no longer sends email


haz

Recommended Posts

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

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

<?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?

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.