...

View Full Version : PHP mail problem



neda
03-05-2008, 01:59 PM
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

abduraooft
03-05-2008, 02:19 PM
Try by giving

mysql_query($query,$dataLink) or die(mysql_error()); to see any errors in DB object.

Nothinglastz
03-06-2008, 04:54 AM
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) ?

_Aerospace_Eng_
03-06-2008, 05:04 AM
Also your mail() function is setup improperly. Try this

$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);



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum