PHP not sending email
Recently, I migrated my website to InMotion from another web host. I have a FileMaker database running through InMotion that is hosted by a third party database host. The FMPro database is accessed by my logged in users the custom web publishing which is in PHP.
On the previous host a user could send me a message that was emailed to me through a PHP script. Now it is not working. Customers are able to place orders through the FMPro database, so that is not the issue. I am not getting email receipts when they place an order like I did on the previous web host.
Is there something I need to set up on my InMotion site that I am missing.
My customers are able to submit a free order and I do get an email when the order is placed (This does not go through the FMPro database).
Here is the PHP code:
$patname = $_GET["patientname"];
$dentname = $_GET["drlastname"];
$_SESSION['drlastname']=$_GET["drlastname"];
$_SESSION['patient name']=$_GET["patientname"];
$mailto = $_GET['email'];
$email = '[email protected]';
$subject = 'SmilePix Free Case Order';
$name = 'SmilePix';
$message = "Dear Dr. ".$_GET['drlastname']. "\n\n";
$message .= "Thank You for your Free Case order! This is an automated response to let you know \nthat we have received the order. Please review the order information and contact us \nimmediately (by phone at or email) if you need to correct or modify anything.\n\n";
$message .= "First Name: " .$_GET['drfirstname']. "\n";
$message .= "Last Name: " .$_GET['drlastname']. "\n";
$message .= "Company: " .$_GET['compnyname']. "\n";
$message .= "Address: " .$_GET['streetaddress']. "\n";
$message .= "City: " .$_GET['city']. "\n";
$message .= "State: " .$_GET['state']. "\n";
$message .= "Zip: " .$_GET['zipcode']. "\n";
$message .= "Country: " .$_GET['country']. "\n";
$message .= "Phone: " .$_GET['telephone']. "\n";
$message .= "Email: " .$_GET['email']. "\n";
mail($mailto, $subject, $message, "From: \"$name\" <$email>\nReply-To: \"$name\" <$email>\nBcc: [email protected]\nX-Mailer: chfeedback.php 2.01" );
If a logged in user tries to send me a message, I do not get it (this goes through the FMPro database with PHP CWP).
Here is the PHP Code:
$_SESSION['DrId']=$dr_id;
$_SESSION['Salutation']=$Salutation;
$dr_id = $_POST['dr_id'];
$Salutation = $_POST['Salutation'];
$formurl = 'message.php';
$thankyouurl = 'home.php';
$email = $_POST['email'];
$mailto = '[email protected]';
$email2 = $_POST['email'];
$subject = 'Message/Comment';
$name = $_POST['Salutation'];
$message = $_POST['Salutation']. "\n";
$message .= "\nDr. Id: " . $_POST['dr_id']. "\n\n";
$message .= $_POST['email_message_g'];
$http_referrer = getenv( 'HTTP_REFERER' );
if (!isset($_POST['email'])) {
header( 'Location: $formurl' );
exit ; }
mail($mailto, $subject, $message, "From: \"$name\" <$email2>\nReply-To: \"$name\" <$email2>\nX-Mailer: chfeedback.php 2.01" );
As far as I can see they are basically the same.
Any ideas? Thanks in advance for your help - Sam
On the previous host a user could send me a message that was emailed to me through a PHP script. Now it is not working. Customers are able to place orders through the FMPro database, so that is not the issue. I am not getting email receipts when they place an order like I did on the previous web host.
Is there something I need to set up on my InMotion site that I am missing.
My customers are able to submit a free order and I do get an email when the order is placed (This does not go through the FMPro database).
Here is the PHP code:
$patname = $_GET["patientname"];
$dentname = $_GET["drlastname"];
$_SESSION['drlastname']=$_GET["drlastname"];
$_SESSION['patient name']=$_GET["patientname"];
$mailto = $_GET['email'];
$email = '[email protected]';
$subject = 'SmilePix Free Case Order';
$name = 'SmilePix';
$message = "Dear Dr. ".$_GET['drlastname']. "\n\n";
$message .= "Thank You for your Free Case order! This is an automated response to let you know \nthat we have received the order. Please review the order information and contact us \nimmediately (by phone at or email) if you need to correct or modify anything.\n\n";
$message .= "First Name: " .$_GET['drfirstname']. "\n";
$message .= "Last Name: " .$_GET['drlastname']. "\n";
$message .= "Company: " .$_GET['compnyname']. "\n";
$message .= "Address: " .$_GET['streetaddress']. "\n";
$message .= "City: " .$_GET['city']. "\n";
$message .= "State: " .$_GET['state']. "\n";
$message .= "Zip: " .$_GET['zipcode']. "\n";
$message .= "Country: " .$_GET['country']. "\n";
$message .= "Phone: " .$_GET['telephone']. "\n";
$message .= "Email: " .$_GET['email']. "\n";
mail($mailto, $subject, $message, "From: \"$name\" <$email>\nReply-To: \"$name\" <$email>\nBcc: [email protected]\nX-Mailer: chfeedback.php 2.01" );
If a logged in user tries to send me a message, I do not get it (this goes through the FMPro database with PHP CWP).
Here is the PHP Code:
$_SESSION['DrId']=$dr_id;
$_SESSION['Salutation']=$Salutation;
$dr_id = $_POST['dr_id'];
$Salutation = $_POST['Salutation'];
$formurl = 'message.php';
$thankyouurl = 'home.php';
$email = $_POST['email'];
$mailto = '[email protected]';
$email2 = $_POST['email'];
$subject = 'Message/Comment';
$name = $_POST['Salutation'];
$message = $_POST['Salutation']. "\n";
$message .= "\nDr. Id: " . $_POST['dr_id']. "\n\n";
$message .= $_POST['email_message_g'];
$http_referrer = getenv( 'HTTP_REFERER' );
if (!isset($_POST['email'])) {
header( 'Location: $formurl' );
exit ; }
mail($mailto, $subject, $message, "From: \"$name\" <$email2>\nReply-To: \"$name\" <$email2>\nX-Mailer: chfeedback.php 2.01" );
As far as I can see they are basically the same.
Any ideas? Thanks in advance for your help - Sam
Perhaps this will help you.
Seth