2012-11-16 4 views
1

이것은 내 코드입니다. ID를 가진 이드에게 이메일을 보낼 때 이메일은 쓰레기로 간다. 이 코드의 문제점을 식별 할 수 없습니다. 예를 들면 다음과 같은 이메일을 보냅니다.메일이받은 편지함으로 직접 보내지지 않습니다.

보낸 사람 : [email protected] To = [email protected] 그런 다음 바로 정크 메일이 발송됩니다.

<?php 

    $name=$_POST['fName']; 
    $yemail = $_POST['yEmail']; 
    $femail=$_POST['fEmail']; 
    $message=$_POST['message']; 
    $from=$yemail; 
    $to=$femail; 
    $subject="Invitation for you"; 
    $mailBody ="<table width='628' border='0'> 

    <tr><td align='left' valign='middle'><p><br><br>Hello,<br><br>This email is a  notification to let you know that your friend has invited you to <br>visit this link <a  href=www.heed-association.org>Heed Association.</a><br><br> Your friend is using this to  help people living in Pakistan by donating some money.<br><br>So your can also contribute in the areas of Health, Education, Environment and Sustainable Development<br> in the earthquake affected areas of Kashmir to improve living conditions and alleviate community distress<br><br><hr><br><br><strong>Regards<br><br>Heed Association</p></td></tr></table>"; 

    $headers = 'MIME-Version: 1.0' . "\r\n"; 

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

    $headers .= 'From: <'.$yemail.'>' . "\r\n"; 


    if (mail($to, $subject, $mailBody, $headers)) { 

    echo "<script language='javascript'> 
      window.location = 'index.php'; 
      </script>"; 


    } else { 
    echo "<script language='javascript'> 
      window.location = 'tell_a_form.php'; 
      </script>"; 
    } 



    ?> 
+2

이것은 야후의 스팸 필터와 관련이있는 것으로 보인다. 보낸 사람 필드에 스팸이받는 사람의 주소를 포함하는 것은 드문 일이 아니므로 야후가 반응하는 것일 수 있습니다. – Barmar

+0

mail()을 사용하여 보내지는 메일은 스팸으로 처리되는 경우에도 매우 일반적입니다. 그것은 메일을 보내는 좋은 방법이 아닙니다. phpmailer 나 swiftmailer와 같은보다 완벽한 시스템을 사용하십시오. –

답변

1

아마 과민 한 스팸 필터 일 것입니다. 많은 프로그램은 "보낸 사람"열에 나열된 전자 메일 주소에서 전자 메일이 실제로 보내지지 않았는지 여부를 감지 할 수 있습니다. 일반적으로이를 피하는 방법은 이메일을 "[email protected]"에서 가져 오는 것입니다.

2

스팸 필터를 확인하십시오. 어리석은 소리처럼 안전한 발신자 목록에 이메일을 추가하십시오. 코드에서 정말 펑키 한 일이없는 것처럼 보입니다.

+0

yahoo 스팸 필터 규칙 및 규정을 확인하려면 어떻게해야합니까 :) –

+0

yahoo 계정 내부에서해야합니다. 내가 야후를 사용한 이후로 꽤 오래되었습니다. 그러나 일반적으로 전자 메일이 스팸 폴더에있는 동안 전자 메일을 열고 "스팸이 아님"단추를 클릭하면 해당 전자 메일의 모든 전자 메일이 안전해야합니다. – MyCodeSucks

+0

OK 나는이 과정을 진행할 것이다 thnkz @TyrionLannister –