【问题标题】:sent auto reply email form in php在php中发送自动回复电子邮件表单
【发布时间】:2014-11-05 16:27:00
【问题描述】:

这是我的 php 代码:

<?php
$to = 'makingmoney497@gmail.com';
$subject = 'New EMail From Your web site:MakeMoneyCorner.com';
$name = $_POST['name'];
$email = $_POST['email'];
$message = <<<EMAIL

from $name
his email is:$email
EMAIL;

$header = '$email';

if($_POST){
   mail($to, $subject, $message, $header, $feedback)
   $feedback = 'your information has been successfully Send it';

}

if ($mail->send()){ 
 $autoemail = new PHPMailer(); 
 $autoemail->From = "makingmoney497@gmail.com"; 
 $autoemail->FromName = "makingmoneycorner.com"; 
 $autoemail->AddAddress($mail->From, $mail->FromName); 
 $autoemail->Subject = "This Is Your Book About Making Money"; 
 $autoemail->Body = "you can download here :";
 $autoemail->Send(); 
 }  

 ?>

** // 表单很好用,我可以收到访问者发送的电子邮件,但回复不起作用 为什么?

问题的图片:http://www.gulfup.com/?e4Nb5X

【问题讨论】:

  • 第 17 行缺少;

标签: php html forms email replay


【解决方案1】:

编辑:如果您的 mail() 工作正常,请使用该功能而不是 PHPMailer(),因为我之前的代码应该同时提供这两个功能。

$to = 'makingmoney497@gmail.com';
$subject = 'New EMail From Your web site:MakeMoneyCorner.com';
$name = $_POST['name'];
$email = $_POST['email'];
// Your message is set up strangely, try this:
$message = "
From: ".ucwords($name)."
Sent by: $email";
// Your header needs the words "From: " in it
$header = "From: $email";

if($_POST){
    // You are saying if the mail to you succeeds, continue on.
    if(mail($to, $subject, $message, $header)) {
        // Your browser message to them
        $feedback = 'your information has been successfully Send it';
        if(filter_vars($email, FILTER_VALIDATE_EMAIL)) {
            $headerRep  = "From: makingmoneycorner.com <makingmoney497@gmail.com>";
            $subjectRep =   "This Is Your Book About Making Money";
            $messageRep =   "you can download here :";
            mail($email, $subjectRep, $messageRep, $headerRep);
        }
    }
}

【讨论】:

  • 它不起作用我没有收到任何重播消息。你能告诉我其他代码用它来发送自动重播吗?谢谢:)
  • 这些地址是否正确? $autoemail-&gt;AddAddress($email, $name);你希望它在哪里回复?
  • 另外,您发送的内容非常简单,为什么不清理回复电子邮件地址并使用 mail() 发送自动回复,就像您为您所做的那样,而不是 PHPMailer()??
  • 我不明白你在说什么;我需要的只是一个代码,当访问者输入他的电子邮件和姓名时,它会自动重播链接;请问我该怎么做,
  • 我很抱歉这么说,但它不起作用,我从访问者那里得到消息,但我没有得到访问者没有得到重播
【解决方案2】:
this th hole code that i use :

'
<?php


$to = 'makingmoney497@gmail.com';
$subject = 'New EMail From Your web site:MakeMoneyCorner.com';
$name = $_POST['name'];
$email = $_POST['email'];
$message = <<<EMAIL

from $name
his email is:$email
EMAIL;

$header = '$email';

if($_POST){
    // You are saying if the mail to you succeeds, continue on.
    if(mail($to, $subject, $message, $header, $feedback)) {
        // Your browser message to them
        $feedback = 'your information has been successfully Send it';
        if(filter_vars($email, FILTER_VALIDATE_EMAIL)) {
            $headerRep  = "From: makingmoneycorner.com <makingmoney497@gmail.com>";
            $subjectRep =   "This Is Your Book About Making Money";
            $messageRep =   "you can download here :";
            mail($email, $subjectRep, $messageRep, $headerRep);
        }
    }
}






?>'






<!doctype html>
<html>
<head>
<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />

<title>make money online</title>
</head>
    <div id="wrap">    

    <br> .</br>

            <form action="?" method="post" >

               <ul>
                  <li>
                     <label for="name">Your Name:</label>
                     <input type="text" name="name" id="name" />
                  </li>

                  <li>
                     <label for="email">Your  Email:</label>
                     <input type="email" name="email" id="email" />
                  </li>

                  <li>
                    <input type="submit" value="submit"  />
                  </li>
               </ul>

            </form>




  <p id="feedback"><?php echo $feedback ?></p> 
       <div id="hurry">
           <input type="image" src="<?php echo bloginfo('template_directory') . '/images/hurry.png';?>" /> 
       </div><!--end hurry-->
    </div> <!--END WRAP-->

   </body>


</html>

'

【讨论】:

  • 好的,现在试试我的修改。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-10-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多