Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/277.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP需要回复电子邮件才能更“可靠”;可读的;_Php_Forms - Fatal编程技术网

PHP需要回复电子邮件才能更“可靠”;可读的;

PHP需要回复电子邮件才能更“可靠”;可读的;,php,forms,Php,Forms,这是我老板说的。我已经设置好了,需要一些帮助来定制邮件回复。 这里是链接到。 以下是我为通过电子邮件发送联系人表单而设置的php的代码: <?php error_reporting(E_ALL); ini_set('display_errors', 1); //reporting errors if(isset($_POST["Form_Submission"])){ //Checking for blank Fields.. if($_POST["name"]==""||$_POST

这是我老板说的。我已经设置好了,需要一些帮助来定制邮件回复。 这里是链接到。 以下是我为通过电子邮件发送联系人表单而设置的php的代码:

<?php

error_reporting(E_ALL);
ini_set('display_errors', 1);
//reporting errors

if(isset($_POST["Form_Submission"])){
//Checking for blank Fields..
if($_POST["name"]==""||$_POST["email"]==""||$_POST["company"]==""||  $_POST["phone-number"]==""||$_POST["message"]==""){
echo "Please fill out all fields. Thank you.";
}else{
// Check if the "Sender's Email" input field is filled out
$email=$_POST['email']; 

// Sanitize e-mail address
$email =filter_var($email, FILTER_SANITIZE_EMAIL);

// Validate e-mail address
$email= filter_var($email, FILTER_VALIDATE_EMAIL);

if (!$email){
echo "Invalid Sender's Email";
 }
else{
$message ="Contact Submission: \n";
foreach ($_POST as $param_name => $param_val) {
$message .= "Name: $param_name -- Value: $param_val\n";
};
$message .= "//End Form";
$email_subject = "Form Submit";
$email = 'From:'. $email . "\r\n"; // Sender's Email
$email = 'Cc:'. $email . "\r\n"; // Carbon copy to Sender

// message lines should not exceed 70 characters (PHP rule), so wrap it
$message = wordwrap($message, 70);
// Send mail by PHP Mail Function
mail($recipient, $email_subject, $message);
echo "Your mail has been sent successfuly ! Thank you for reaching out to us!";
}
}
};

?>

如果只是为了你的老板,那就用firebug和screen哈哈。对不起。您可以阅读邮件功能的文档。您可以在邮件中添加用于html的标题,这样您就可以根据需要设计它们<代码>//若要发送HTML邮件,必须将内容类型标头设置为$headers='MIME Version:1.0'。“\r\n”$标题。='内容类型:文本/html;字符集=iso-8859-1'。“\r\n”编辑:链接:谢谢您的编辑@Alex Howansky.@Xenofex谢谢我会试试的