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: nthapa3@yahoo.com' . "\r\n";//  $headers .= 'Bcc: birthdaycheck@example.com' . "\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
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: nthapa3@yahoo.com' . "\r\n";//  $headers .= 'Bcc: birthdaycheck@example.com' . "\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
Share on other sites

<?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: nthapa3@yahoo.com' . "\r\n";//  $headers .= 'Bcc: birthdaycheck@example.com' . "\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
Share on other sites

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.