php联系表格“发送邮件时出现了一些问题。”

问题描述:

我是一个nebie到php。我正在使用预生成html模板。我必须配置下面提到的表单。我改变了两个值:php联系表格“发送邮件时出现了一些问题。”

$emailAdmin = "[email protected]", 
$urlWebSite = "mydomain.co.cc" 

但是当我点击发送电子邮件。它给出了一个错误消息“发送邮件时出现了一些问题。”

<?php 
// ------------------------------------------------ ----------------------------------- 
// CONFIGURATION PARAMETERS OF GENERAL 
// ------------------------------------------------ ----------------------------------- 
$emailAdmin = "[email protected]", // 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 <[email protected]_domain.com> \ nReply-to: [email protected]_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文件,我还没有配置,但它的存在,默认情况下,包含文件夹:

<?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 ([email protected]($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>"; 
} 
+1

*“发送邮件时出现了一些问题”*不是PHP错误,无法在您发布的代码中找到。这个问题目前没有问题,但几乎可以肯定地问过http://stackoverflow.com/questions/tagged/php+email – 2012-02-24 14:44:39

+0

你的mail()函数在哪里?你定义了很多,但我看不到你发送它 - 看到http://php.net/manual/en/function.mail.php – Neysor 2012-02-24 14:45:38

+0

那么你是正确的它不是PHP的错误,但它显示在我的浏览器弹出消息。 – 2012-02-24 14:46:46

你错过了mail() PHP函数

+1

他的问题集中在错误信息上。这应该是一个评论,要求更多的代码B/C它显然缺少大块。 – 2012-02-24 14:45:49