Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/286.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 联系方式不包括';t work 2错误_Php_Html_Forms_Email_Post - Fatal编程技术网

Php 联系方式不包括';t work 2错误

Php 联系方式不包括';t work 2错误,php,html,forms,email,post,Php,Html,Forms,Email,Post,我的联系方式有问题,请不要发送。不幸的是,我对我的服务器提供商提供的下面的PHP回答不友好 “感谢您联系我们。我想通知您,联系人表单显示发件人的电子邮件地址(应显示在server home.pl中创建的电子邮件地址): 2014年8月30日12:49:26[/usr/run/smtp]socket/plain(php5:xxxx.com/form/contact.php[1 work]DOCUMENT\u ROOT=/SCRIPT\u FILENAME=/form/contact.php)[se

我的联系方式有问题,请不要发送。不幸的是,我对我的服务器提供商提供的下面的PHP回答不友好

“感谢您联系我们。我想通知您,联系人表单显示发件人的电子邮件地址(应显示在server home.pl中创建的电子邮件地址): 2014年8月30日12:49:26[/usr/run/smtp]socket/plain(php5:xxxx.com/form/contact.php[1 work]DOCUMENT\u ROOT=/SCRIPT\u FILENAME=/form/contact.php)[serwer111111]mess:e72823aae943c292 1108从:[magda.serwer111111]到:[magda.serwer111111]状态:本地错误554 5.7.1伪造发件人地址:

此外,默认电子邮件地址字段THIS:的管理由无效值(变量不替换正确值)补充: 2014年8月30日12:49:26[/usr/run/smtp]socket/plain(php5:xxxx.com/form/contact.php[1 work]DOCUMENT_ROOT=/SCRIPT_FILENAME=/form/contact.php)[serwer111111]mess:bf5e99f8a1316c4b703 from:[serwer111111]至:[状态:远程正常[0830124926_FE40E30F]

这是我的联系方式:

<?php

$receiving_email_address = "zydol@xxxx.com"; // Set your email address here which you want to receive emails to

$receiving_email_address_name = "Zydol"; // Add name that is associated with your email address above.

$custom_subject = "email from xxxx.com"; // Change the subject line of email as per your choice.

// ============================= DO NOT EDIT BELOW THIS LINE ======================================

if ((isset($_POST['name'])) && (strlen(trim($_POST['name'])) > 0)) { $name = stripslashes(strip_tags($_POST['name'])); } else {$name = 'No name entered';}

if ((isset($_POST['phone'])) && (strlen(trim($_POST['phone'])) > 0)) { $phone = stripslashes(strip_tags($_POST['phone'])); } else {$phone = 'No phone entered';}

if ((isset($_POST['email'])) && (strlen(trim($_POST['email'])) > 0)) { $email = stripslashes(strip_tags($_POST['email'])); } else {$email = 'No email entered';}

if ((isset($_POST['datetimepicker'])) && (strlen(trim($_POST['datetimepicker'])) > 0)) { $datetimepicker = stripslashes(strip_tags($_POST['datetimepicker'])); } else {$datetimepicker = 'No email entered';}

if ((isset($_POST['comment'])) && (strlen(trim($_POST['comment'])) > 0)) { $comment = stripslashes(strip_tags($_POST['comment'])); } else {$phone = 'No comment entered';} ob_start();

// Email Building 
$to = $receiving_email_address; 
$email = $_POST['email']; 
$fromaddress = $_POST['email']; 
$fromname = $_POST['name']; 
$body = "Below are the details submitted by the user on your website.

Name: ".$_POST['name']."

Email: ".$_POST['email']."

Phone: ".$_POST['phone']."

Date & Time: ".$_POST['datetimepicker']."

Comment: ".$_POST['comment']."";

// Check if the security is filled 

if ( $_POST['security'] == '' ) {

    require("phpmailer.php");
    $mail = new PHPMailer();

    $mail->From                        = "$email";
    $mail->FromName            = "$fromname";
    $mail->AddAddress("$receiving_email_address","$receiving_email_address_name");

    $mail->IsHTML(true);

    $mail->Subject                 = "$custom_subject";
    $mail->Body                        = $body;
    $mail->AltBody                     = "This is the text-only body";

    if(!$mail->Send()) {
        $recipient                     = '$receiving_email_address';
        $subject                       = 'Contact form failed';
        $content                       = $body; 



  // Send Mail


mail($recipient, $subject, $content, "From: $receiving_email_address\r\nReply-To: $email\r\nX-Mailer: DT_formmail");
  exit;
}

} ?>

有人能帮我吗? 先谢谢你
Zydol

第一条消息是因为您设置了
$email

添加行

$email = $_POST['email'];

你能告诉我该把这句话放在哪里吗?@Zydol-before
require(“phpmailer.php”);
不,我有一些代码:
$to=$receiving\u-email\u-address;
$email=$\u-POST['email'];
$fromname=$\u-POST['name']
@zydol但它被注释掉了!好吧,对不起我的错误,我只是复制了错误的代码来发布,现在可以了。它没有注释。问题仍然存在