2014-03-04 8 views
0

정말 도움이 될 것 같습니다. 다음 전자 메일 양식을 작성했으며 내 개인 도메인 전자 메일 주소 ([email protected])와 함께 작동하지만 회사 전자 메일 주소 ([email protected])는 다음과 같이 더 강력한 스팸 필터가 있어야합니다. 거기를 빠져 나가지 못한다. 나는 이제 개별 MIME 유형, 즉 text/html 및 text/plain을 클라이언트 측에서 다양하게 구성하여 스팸 수준을 줄이려고합니다. 다음 자습서를 살펴 보았습니다. http://www.tek-tips.com/faqs.cfm?fid=2681PHP 문의 양식을 스팸으로 표기

문제는 의미가 없습니다. 누구든지 문제를 해결하고 별도의 머리글 등을 정렬하는 방법을 알려주는 올바른 방향으로 나를 가리킬 수 있습니까?

<?php 
    { 
    $to = "[email protected], [email protected]"; 
    $subject = "Quotation Request from Work Website."; 
    $headers = "Content-type:text/html;charset=iso-8859-1"; 
    $first_name = filter_input(INPUT_POST, 'first_name'); 
    $last_name = filter_input(INPUT_POST, 'last_name'); 
    $telephone = filter_input(INPUT_POST, 'telephone'); 
    $gotNumberFrom = filter_input(INPUT_POST, 'gotNumberFrom'); 
    $quoteFor = filter_input(INPUT_POST, 'quoteFor'); 
    $address = filter_input(INPUT_POST, 'address'); 
    $takenBy = filter_input(INPUT_POST, 'takenBy'); 

    $message = 
    "<span style='font-weight: bold;'>Name: </span>"."<br />".$first_name." ".$last_name."<br />"."<br />". 
    "<span style='font-weight: bold;'>Telephone: </span>"."<br />".$telephone."<br />"."<br />". 
    "<span style='font-weight: bold;'>Address of Works: </span>"."<br />".$address."<br />"."<br />". 
    "<span style='font-weight: bold;'>Quotation for: </span>"."<br />".$quoteFor."<br />"."<br />". 
    "<span style='font-weight: bold;'>Got our number from: </span>"."<br />".$gotNumberFrom."<br />"."<br />". 
    "<span style='font-weight: bold;'>Quotation taken by: </span>"."<br />".$takenBy."<br />"; 

    mail($to, $subject,"<html>Hola!<br /> Please find details below of the individual that has requested a quotation Gaffer.<br /> 
     <br />" . $message . "</html>", $headers); 
    echo "Your message has been successfully sent, here's a lollipop. <br />"?> 
<?php } 
?> 

모든 도움을 주시면 감사하겠습니다.

+1

메일 기능에 적절한 헤더를 보내십시오. –

답변

3

문제의 주된 이유는 부적절한 헤더이며, 메일 기능에 적절한 헤더를 전달하면 좋은 결과를 얻을 수 있습니다. 다음 예를 사용할 수 있습니다.

$headers = "From: My site<[email protected]>\r\n"; 
$headers .= "Reply-To: [email protected]\r\n"; 
$headers .= "Return-Path: [email protected]\r\n"; 
$headers = "MIME-Version: 1.0\r\n"; 
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; 
+0

굉장! 이렇게하면 이메일이 내 직장 주소에 도달 할 수 있지만 이메일은 여전히 ​​메시지 내의 HTML을 렌더링하지 않고 이메일의 모든 HTML 요소를 표시하는 일반 텍스트로 붙여 넣기 만합니다. –

+0

누구에게 더 이상의 정보가 있습니까? –

관련 문제