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 = "[email protected]"; //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
https://forums.phpfreaks.com/topic/74111-mail-help/page/2/#findComment-374398
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 = "[email protected]"; //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
https://forums.phpfreaks.com/topic/74111-mail-help/page/2/#findComment-374399
Share on other sites

<?php

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


// basic mail variables
$to = "[email protected]"; //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
https://forums.phpfreaks.com/topic/74111-mail-help/page/2/#findComment-374420
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.