2013-03-01 3 views
0

여러 가지 질문을 조사하고 여러 옵션을 시도한 후에도 문제가 해결되지 않았습니다.PHP 메일 기능이 작동하지 않습니다.

본인은이 문의 양식을 보내지 않을 것입니다.

<form id="contact" method="post" action="process.php"> 
    <fieldset> 

     <label for="name">Name:</label> 
     <input type="text" name="name" placeholder="Your name" title="Your name" class="required"> 

     <label for="email">E-mail:</label> 
     <input type="email" name="email" placeholder="[email protected]" title="Your e-mail address" class="required email"> 

     <label for="phone">Phone number:</label> 
     <input type="tel" name="phone" placeholder="+34 111 22 33 44" title="Your phone number"> 

     <p>&nbsp;</p> 
     <input type="radio" name="rsvp" value="si"> 
     <span class="destacar-contacto">ACCEPT</span> the invitation<br> 
     <input type="radio" name="rsvp" value="no"> 
     <span class="destacar-contacto">REJECT</span> the invitation<br> 

     <p>&nbsp;</p> 
     <p class="negrita-contacto">If you're coming: what would you like better?</p> 
     <input type="radio" name="menu" value="carne"> Calf sirloin with foie<br> 
     <input type="radio" name="menu" value="pescado"> Marinade salmon with dill<br> 
     <input type="radio" name="menu" value="vegetariano"> Fungus risotto<br> 

     <label for="mas">Is someone coming with you? Let us know their name and their prefered menu here:</label> 
     <textarea name="mas"></textarea> 

     <label for="message">Aditional message:</label> 
     <textarea name="message"></textarea> 

     <input type="submit" name="submit" class="boton" id="submit" value="Enviar" /> 

    </fieldset> 
</form> 

그리고 이것은 PHP 함수는 다음과 같습니다

$name = strip_tags($_POST['name']); 
$email = strip_tags($_POST['email']); 
$phone = strip_tags($_POST['phone']); 
$rsvp = strip_tags($_POST['rsvp']); 
$menu = strip_tags($_POST['menu']); 
$mas = strip_tags($_POST['mas']); 
$message = strip_tags($_POST['message']); 

mail("[email protected]", "rsvp", 
"Name: $name\nEmail: $email\nPhone: $phone\nRsvp: $rsvp\nMenu: $menu\nMas: $mas\nMessage: $message\n", 
"From: Our Dream Journey <[email protected]>"); 

난 그냥 보내 무작위로 시도 "이름 : $ 이름을"나는 이메일을 받았습니다! 하지만 다른 모든 옵션을 다시 돌려 놓으십시오.

누군가 저를 도울 수 있습니까?

미리 감사드립니다. :)

+0

메일'mail ('[email protected] ','test ','message ') 만 보내시겠습니까? ? ' –

+0

스팸 필터가 차단하고 있습니다. 메시지가 수신되지 않으면 메시지의 내용을보고 스팸성 키워드를 보냅니 까? 또한 디버그하려면'mail()'의 반환 값을 검사하여 전달이 받아 들여 졌는지 확인해야합니다. – MrCode

+0

@MarinSagovac 네, 저도 해보았습니다. "Name : $ name \ nEmail : $ email \ nPhone : $ phone \ nRsvp : $ rsvp \ nMenu : $ menu \ nMas : $ mas \ n 메시지 : $ message \ n " –

답변

0

phpMailer 클래스를 사용할 수 있습니다. 이 라이브러리를 여기에서 다운로드하십시오. 이메일을 보내는 많은 예.

http://code.google.com/a/apache-extras.org/p/phpmailer/downloads/list

편집 :

$headers = "From: [email protected]\r\n"; 
$headers .= "Reply-To: [email protected]\r\n"; 
$headers .= "Return-Path: [email protected]\r\n"; 
$headers .= "CC: [email protected]\r\n"; 
$headers .= "BCC: [email protected]\r\n"; 

:

이 코드

$headers = 'MIME-Version: 1.0' . "\r\n"; 
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 

    // Additional headers 
    $headers .= 'From:Our Dream Journey <[email protected]>' . "\r\n"; 

    if(mail("[email protected]", "rsvp",nl2br("Name: $name\nEmail: $email\nPhone: $phone\nRsvp: $rsvp\nMenu: $menu\nMas: $mas\nMessage: $message\n"), 
    $headers)) echo "Sent"; die; 
+0

Kya baat hai sir :-) – ravisoni

0

시도가 헤더 요소에 모든 정보를 추가하십시오
어쩌면 내가 기억하지 못하는 다른 옵션이있을 수도 있습니다.
또 다른 문제는 일부 변수가 문자열을 닫는 것입니다 (문자열 닫기). 어딘가에, file_put_contents가있는 파일을 인쇄하거나 그냥 다시 보내십시오.

관련 문제