PHP는

2014-11-05 2 views
0

이 내 PHP 코드를 자동 응답 이메일 양식을 보내PHP는

<?php 
$to = '[email protected]'; 
$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 = "[email protected]"; 
$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(); 
} 

?> 

** // 큰 형태의 작품은, 내가 방문자가 보내는 이메일을받을 수 있지만 응답이 왜 작동하지 않는 이유는 무엇입니까? 문제의

IMG : http://www.gulfup.com/?e4Nb5X

+0

'누락,'라인 (17)에? – Bijan

답변

0

편집 : 내 앞의 코드는 모두 전달해야하기 때문에 당신의 mail()가 작동하면가 대신 PHPMailer()의 기능을 사용합니다.

$to = '[email protected]'; 
$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 <[email protected]>"; 
      $subjectRep = "This Is Your Book About Making Money"; 
      $messageRep = "you can download here :"; 
      mail($email, $subjectRep, $messageRep, $headerRep); 
     } 
    } 
} 
+0

그것은 어떤 재생 메시지도받지 못했습니다. autohmatic 재생 당신을 보내 그것을 사용하려면 onther 코드를 말해 줄 수 있습니까 :) –

+0

오류가 활성화되어 있습니까? – Rasclatt

+0

이 주소가 맞습니까? $ autoemail-> AddAddress ($ email, $ name);'어디서 답장을 하시겠습니까? – Rasclatt

0
this th hole code that i use : 

' 
<?php 


$to = '[email protected]'; 
$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 <[email protected]>"; 
      $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> 

' 
+0

Ok. 지금 내 개정판을 시험해보십시오. – Rasclatt