Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Feb 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP mail problem

    Hi there,
    I have an e-card system on my website, which was working fine until my host performed an upgrade from PHP4 to PHP5 a few days ago. Now the recepient does not receive the email telling him/her to view the e-card.The postcard system can be found on: www.tickity-boo.co.uk/site/postcard.php and the script is as follows:
    <?php
    require_once ("database.php");
    $page = $_SERVER['HTTP_REFERER'];
    $card = $_POST['postcard'];
    $stamp = $_POST['stamp'];
    $sname = $_POST['sname'];
    $semail = $_POST['semail'];
    $rname = $_POST['rname'];
    $remail = $_POST['remail'];
    $message = $_POST['message'];
    $database = new TB_Database;
    $dataLink = $database->DB_databaseConnect();
    $query = "INSERT INTO tbPost(post_card , post_stamp, post_sname, post_semail , post_rname, post_remail, post_message, post_date, post_active) VALUES ('$card', '$stamp', '$sname', '$semail', '$rname', '$remail', '$message', now(), '1')";
    mysql_query($query,$dataLink);
    $postid = mysql_query("SELECT MAX(post_id) FROM tbPost");
    $post = mysql_fetch_array($postid);
    if ($page=="http://www.tickity-boo.co.uk/site/postcard04.php")
    {
    $subject= $semail." has sent you an e-card";
    $header= "From: info@tickity-boo.co.uk\r\n";
    $header.= "Content-Type: text/html\r\n\r\n";
    $header.= "<html><p>Hi,</p>";
    $header.= "<p>You have been sent an e-card from ".$sname."</p>";
    $header.= "<p>It can be viewed at <a href=\"http://www.tickity-boo.co.uk/site/postview.php?post=".$post['MAX(post_id)']." \">www.tickity-boo.co.uk/site/postview.php?post=".$post['MAX(post_id)']."</p>";
    $header.= "</html>";
    mail($remail,$subject,"","MIME=Version:1.0\r\n$header");
    }
    mysql_close($dataLink);
    ?>

    Any help would be much appreciated.
    Many thanks,
    Aden

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Try by giving
    Code:
    mysql_query($query,$dataLink) or die(mysql_error());
    to see any errors in DB object.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Sep 2007
    Location
    Hanoi, Vietnam
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    do you have any mail daemon installed and properly run ? Is any of the following ports opened: 25,26, 110, 111 (on your hosting server) ?

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Also your mail() function is setup improperly. Try this
    PHP Code:
    $subject$semail." has sent you an e-card";
    $header"From: info@tickity-boo.co.uk\r\n";
    $header.= "MIME=Version:1.0\r\n";
    $header.= "Content-Type: text/html\r\n\r\n";
    $message"<p>Hi,</p>";
    $message.= "<p>You have been sent an e-card from ".$sname."</p>";
    $message.= "<p>It can be viewed at <a href=\"http://www.tickity-boo.co.uk/site/postview.php?post=".$post['MAX(post_id)']." \">www.tickity-boo.co.uk/site/postview.php?post=".$post['MAX(post_id)']."</p>";
    mail($remail,$subject,$message,$header); 
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •