Problem with sending web data to a email account...
Posted: Thu Mar 25, 2010 3:42 am
I have a Linux(Redhat) server to host my website. It used to be worked fine when people submit their info. by pressing submit button; data will send to my email account.
One day this function does not work anymore. I was told somebody submitted the info., and I haven't received any email.
I checked it myself. I found that "Your info. has been sent successfully" is shown, but I never got the email.
By the way, how to check if the smpt in linux is working. Thank you.
Below code is part of
Below code is part of Constant.php
...
...
One day this function does not work anymore. I was told somebody submitted the info., and I haven't received any email.
I checked it myself. I found that "Your info. has been sent successfully" is shown, but I never got the email.
By the way, how to check if the smpt in linux is working. Thank you.
Below code is part of
Code: Select all
contact. php
<?
ob_start();
include('Constant.php');
session_save_path ($s_Save_Path);
session_start();
?>
...
...
<? if ($filled == "contact") {
$subject = "Online Survey";
$mailbody = "========== Survey ==========\n".
"Name: $name\n".
"Email: $email\n".
"Tel: $tel\n".
"Fax: $fax\n".
"========== Content ===========\n".
"$content".
"\n=========================================";
$headers .= "From: $name <$email>\n";
$headers .= "Reply-To: $email\n";
$headers .= "X-Mailer: PHP\n"; // mailer
$headers .= "Return-Path: <$email>\n"; // Return path for errors
if (mail("$c_AdminEmail", "$subject", "$mailbody", "$headers")){
$sysmsg = "Your info. has been sent successfully";
} else {
$sysmsg = "Server Error ";
}
?>...
...
Code: Select all
$s_Save_Path = "/usr/local/apache/htdocs/skilltest/sessionfile";
$DBserver = "localhost";
$DBuser = "root";
$DBpw = "";
$DBname = "WCPSPE";
$DB_Path = "DB/";
$genGraph = "/usr/local/apache/htdocs/skilltest/";
$reportFolder = "/usr/local/apache/htdocs/reportFolder";
$displayReportFolder = "../reportFolder";
$skilltestFolder = "../skilltest/";
$c_AdminEmail = 'my@myemail.com';