php联系人表格”;发送电子邮件时出现了一些问题&”;


php contact form "Have been some problems sending the email."

我是php的新手。我使用的是预构建的html模板。我必须配置下面提到的表格。我更改了两个值:

$emailAdmin = "myemailid@gmail.com",
$urlWebSite = "mydomain.co.cc"

但当我点击发送电子邮件时。它会显示一条错误信息"发送电子邮件时出现了一些问题。"

<?php
// ------------------------------------------------ -----------------------------------
// CONFIGURATION PARAMETERS OF GENERAL
// ------------------------------------------------ -----------------------------------
$emailAdmin = "myemailid@gmail.com", // email admin where notices are sent
$urlWebSite = "mydomain.co.cc" // Website URL That Is added to the bottom of emails sent from contact form
$headers_mail = "From: Company Name <info@your_domain.com> ' nReply-to: info@your_domain.com";
define ("OGGETTO_MAIL", "Contact from the site.");
$str_contenuto_email = "
You are receiving this email Because someone used the card of contacts on your website.
Here the personal information we have That Contacted:
-------------------------------------------------- -----------
Name and Surname: {name}
E-mail: mail {}
IP Address: {ip}
-------------------------------------------------- -----------
This is the user's request:
-------------------------------------------------- -----------
Message: {body}
-------------------------------------------------- -----------
{url} ";
?>

我忘了提到另一个php文件,我还没有配置它,但它默认在include文件夹中:

<?php
include_once("config.php");
//------------------------------------------------------------------------------------------------
// RECUPERO IL VALORE DI TUTTI I DATI INVIATI DALL'UTENTE
//------------------------------------------------------------------------------------------------
$str_ind_ip = $_SERVER['REMOTE_ADDR'];
foreach ($_POST as $key=>$value) {
    $$key = $value;
}
//------------------------------------------------------------------------------------------------
//  PROCEDURA DI INVIO MAIL
//-------------------------------------
$str_oggetto            = OGGETTO_MAIL;
$str_contenuto_email    = str_replace("{name}",$visitor,$str_contenuto_email);
$str_contenuto_email    = str_replace("{mail}",$visitormail,$str_contenuto_email);
$str_contenuto_email    = str_replace("{ip}", $str_ind_ip,$str_contenuto_email);
$str_contenuto_email    = str_replace("{corpo}",$notes,$str_contenuto_email);
$str_contenuto_email    = str_replace("{url}",$urlWebSite,$str_contenuto_email);
$headers                = $headers_mail;
if (!@mail($emailAdmin,$str_oggetto,$str_contenuto_email,$headers)) {
    echo "<div class='"error'">Have been some problems sending the email.</div>";
} else {
    echo "<div class='"success'">The email has been sent successfully.</div>";
}

您缺少mail()php函数