无法通过“mail()”函数

时间:2017-08-11 06:49:20

标签: php

我试图通过php中的“mail()”函数获取我的邮件ID上的“用户信息”。 mail()函数以前工作正常,但现在它不能正常工作。这是我的HTML代码:

<form name="contactForm" class="standard-form row-fluid" action="contact.php" method="post" >
 <input class="span6" name="themeple_name" placeholder="Name" type="text" id="themeple_name" value="" / style="float:left; background-color:#fff;">

<input class="span6" name="themeple_email" placeholder="E-Mail" type="text" id="themeple_email" value="" / style="background-color:#fff;">

 <input class="span6" name="themeple_subject" placeholder="Subject" type="text" id="themeple_subject" value="" required>

 <textarea class="span12" placeholder="Message" name="themeple_message" cols="40" rows="7" id="themeple_message" style="background-color:#fff;"></textarea>

 <p class="perspective">
     <input type="submit" value="Submit Form" class="btn-system normal default" /> </p>
</form>

这是我的php文件:

<?php 

    $headers = "From: xyz@gmail.com";
    $to = "xyz@gmail.com"; 
    $Email = $_POST['themeple_email'];
    $Name = $_POST['themeple_name'];
    $Subject = $_POST['themeple_subject'];
    $Message = $_POST['themeple_message'];
    $subject = "Form submission";
    $email_message = "Form details below. \r\n";
    $email_message .= "Name: ".$Name. "\r\n";
    $email_message .= "Email: ".$Email. "\r\n";
    $email_message .= "subject: ".$Subject. "\r\n";
    $email_message .= "Message: ".$Message. "\r\n";

    mail ($to, $subject, $email_message, $headers);
    header("Location: thank-you.html");



//echo "MAIL SENT " . $Name . $Email . $Phone . $Message;
?>

提前致谢。

0 个答案:

没有答案