PHP邮件形成故障排除

时间:2013-09-27 09:17:14

标签: php

我非常坚持这一点,过去我曾经制作过php邮件表格,但是我的大脑并没有在这个上工作。任何想法都会非常有用。

<?php
if(isset($_POST['email'])) {


$email_to = "paulsizer12@gmail.com";
$email_subject = "eKoWeld Feedback";

$email_message = "Form details below.\n\n";

function clean_string($string) {
  $bad = array("content-type","bcc:","to:","cc:","href");
  return str_replace($bad,"",$string);
}

$company_name = $_POST['company_name']; 
$contact_name = $_POST['contact_name']; 
$industry = $_POST['industry'];
$do = $_POST['do']; 
$material = $_POST['material']; 
$TIG_MIG = $_POST['TIG_MIG'];
$Instructions = $_POST['Instructions'];
$easy = $_POST['easy'];
$Before = $_POST['Before']; 
$After = $_POST['After'];
$Savings = $_POST['Savings'];
$recommend = $_POST['recommend'];
$another = $_POST['another'];
$testimonial = $_POST['testimonial']; 




?>
Thank you for leaving feedback.
<?php
}
?>

1 个答案:

答案 0 :(得分:0)

PHP Mail

<?php
$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>

您忘记添加邮件功能

<?php
if(isset($_POST['email'])) {


$email_to = "paulsizer12@gmail.com";
$email_subject = "eKoWeld Feedback";

$email_message = "Form details below.\n\n";

function clean_string($string) {
  $bad = array("content-type","bcc:","to:","cc:","href");
  return str_replace($bad,"",$string);
}

$company_name = $_POST['company_name']; 
$contact_name = $_POST['contact_name']; 
$industry = $_POST['industry'];
$do = $_POST['do']; 
$material = $_POST['material']; 
$TIG_MIG = $_POST['TIG_MIG'];
$Instructions = $_POST['Instructions'];
$easy = $_POST['easy'];
$Before = $_POST['Before']; 
$After = $_POST['After'];
$Savings = $_POST['Savings'];
$recommend = $_POST['recommend'];
$another = $_POST['another'];
$testimonial = $_POST['testimonial']; 

 mail($to, $subject, $message, $headers); // add this line with your variables 


?>