这是我的代码,我已经做了一切,使其工作,但我卡住了。我无法得到这个代码来发送电子邮件…
<?php
if(isset($_REQUEST['submit']))
{
$to = "usman_86@rocketmail.com";
$subject = "Find Dealer @ flowsleeve";
$headers = "From: Find Dealer ";
$headers .= "Reply-To: ". strip_tags("usman_86@rocketmail.com") . "'r'n";
$headers = 'MIME-Version: 1.0' . PHP_EOL;
$headers .= "Content-Type: text/html; charset=ISO-8859-1'r'n";
$messsage = "
Name : ".$_REQUEST['first_name']."
Email : ".$_REQUEST['email']."
Event Type : ".$_REQUEST['event_type']."
Event location : ".$_REQUEST['event_location']."
Last Name : ".$_REQUEST['last_name']."
Home Phone : ".$_REQUEST['home_phone']."
Event Date : ".$_REQUEST['event_date']."
Referrer : ".$_REQUEST['referrer']."
Message : ".$_REQUEST['message']."";
mail($to,$subject,$message,$headers);
问题在标题部分。您忘了在第8行添加.
。看一看,改正一下。
$headers = "From: Find Dealer ";
$headers .= "Reply-To: ". strip_tags("usman_86@rocketmail.com") . "'r'n";
$headers .= 'MIME-Version: 1.0' . PHP_EOL;
$headers .= "Content-Type: text/html; charset=ISO-8859-1'r'n";
由于这个错误,头将只包含mime版本信息,内容类型和字符集。
我尝试了您的代码,没有if ( isset ..
语句。您的代码工作成功。请添加额外的代码或错误。
确保你也检查了你的垃圾邮件文件夹