Jump to content

mail() help


jonathanellis

Recommended Posts

I still get only a white screen when I click submit on: http://staging.volumeforlife.com/contact.html

 

<?php

//**********************************************************
//						           *
//	volumeforlife.com				   *
//	PHP mailer script created by versionthree	   *
//						           *
//**********************************************************

if(isset($_POST['submit'])) {

// basic mail variables
$to = "jon@versionthree.ca"; //for multiple email addresses separate addresses with a comma
$subject = "Website Comment";
$from = "This has just been sent from www.volumeforlife.com";

// other details
$name_field = $_POST['thename'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$comment = $_POST['comment'];
$date = date("D M d, Y H:i:s");
$message = "$date\n\nName: $thename\nPhone: $phone\nEmail: $email\n\nComment: $comment\n  ";

// Sends email and redirects
  if ($_POST['submit']=="send") { 
     mail($to, $subject, $message, $from); 
     header("Location: http://staging.volumeforlife.com/contact_success.html");
  }else { 
header("Location: http://staging.volumeforlife.com/contact_deny.html");}
  }
}
?>

Link to comment
Share on other sites

get rid of value="send" and then try what you had before i guarantee it will work

 

 

<?php

//**********************************************************
//						           *
//	volumeforlife.com				   *
//	PHP mailer script created by versionthree	   *
//						           *
//**********************************************************


// basic mail variables
$to = "jon@versionthree.ca"; //for multiple email addresses separate addresses with a comma
$subject = "Website Comment";
$from = "This has just been sent from www.volumeforlife.com";

// other details
$name_field = $_POST['thename'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$comment = $_POST['comment'];
$date = date("D M d, Y H:i:s");
$message = "$date\n\nName: $thename\nPhone: $phone\nEmail: $email\n\nComment: $comment\n  ";

// Sends email and redirects
  if ($_POST['submit']=="true") { 
     mail($to, $subject, $message, $from); 
     header("Location: http://staging.volumeforlife.com/contact_success.html");}
  elseif  ($_POST['submit']=="false") {
header("Location: http://staging.volumeforlife.com/contact_deny.html");}
  }

?>

 

also i dont think you need isset when you already are checking if submit is true or false

Link to comment
Share on other sites

<?php

//**********************************************************
//						           *
//	volumeforlife.com				   *
//	PHP mailer script created by versionthree	   *
//						           *
//**********************************************************


// basic mail variables
$to = "jon@versionthree.ca"; //for multiple email addresses separate addresses with a comma
$subject = "Website Comment";
$from = "This has just been sent from www.volumeforlife.com";

// other details
$name_field = $_POST['thename'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$comment = $_POST['comment'];
$date = date("D M d, Y H:i:s");
$message = "$date\n\nName: $thename\nPhone: $phone\nEmail: $email\n\nComment: $comment\n  ";

// Sends email and redirects
  if ($_POST['submit']=="true") { 
     mail($to, $subject, $message, $from); 
     header("Location: http://staging.volumeforlife.com/contact_success.html");}
  elseif  ($_POST['submit']=="false") {
header("Location: http://staging.volumeforlife.com/contact_deny.html");}
  

?>

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.