2013-01-18 1 views
0

PHP를 사용하여 내 웹 사이트 사용자에게 전자 메일을 보내려는 간단한 템플릿이 있습니다.PHP/HTML - HTML 이메일 - Gmail이 내 웹 사이트의 메일을 스팸으로 감지합니까? (템플릿 참조)

나는 이상한 이유로 Gmail이 내 이메일이 스팸이라고 생각하는 것처럼 보였으므로 내 웹 사이트의 모든 메일이 Gmail 주소로 전송되면 스팸 폴더에 저장됩니다.

도메인이 새로운 도메인 인 것처럼 나는 그 이유가 내 사이트가 스팸을 어떤 방식으로 배포하는 것으로 표시되어 의심 스럽습니다. 그래서 나는 그것이 내 html 및 아마도 내가 하이퍼 링크를 사용했던 방식 일 것입니다.

누군가 내가 간단한 예를 들여다 보면서 내가이 모든 것에 잘못하고있는 것을 나에게 설명하면, 오랫동안 내 머리를 긁적이는 것처럼 크게 환영받을 것입니다. 유효하고 규격에 따라?

모든 의견, 제안, 의견 또는 의견을 환영합니다. 감사합니다.

<?php 
// multiple recipients 
$to = "[email protected]"; 

// subject 
$subject = 'Please Confirm User Account Registration'; 

// message 
$message = ' 
<html> 
<head> 
    <title>My Domain User Account Registration</title> 
</head> 
<body> 
    <p>My Domain User Account Registration :</p> 
    <p>We have just received a request to have your information added to our website as a user account. This would enable you to buy products on our website at <a href="http://www.mydomain.com/">http://www.mydomain.com/</a></p> 
    <p>If this is correct and you do wish to create a new user account on our website, please click the link below to be directed our website.</p> 
    <p><a href="http://www.mydomain.com/users/register/confirmation/confirm.php?confirm=12345&key=12345abcde">http://www.mydomain.com/users/register/confirmation/confirm.php?confirm='.$userId.'&key='.$randomKey.'</a></p> 
    <p>If you received this email by mistake, simply delete it. You won&rsquo;t be subscribed if you don&rsquo;t click the confirmation link above and your email address will be removed from our database by tomorrow.</p> 
    <p>For questions about this message, please contact us at : <a href="mailto: [email protected]">[email protected]</a></p> 
    <p>Thank you.</p> 
</body> 
</html> 
'; 

// To send HTML mail, the Content-type header must be set 
$headers = 'MIME-Version: 1.0' . "\r\n"; 
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 

// Additional headers 
$headers .= 'From: Accounts @ www.mydomain.com <[email protected]>' . "\r\n"; 

//Send the message 
mail($to, $subject, $message, $headers); 
?> 

답변

0

제목에 대해 꽤 오랜 시간 동안 내 호스트를 괴롭혔다면 기본적으로 해당 서버가 스팸의 보낸 사람으로 표시되었으므로 문제의 공유 서버에있는 내 웹 사이트의 메일이 자동으로 Gmail 사용자를위한 스팸 폴더 ...

알아 두어야 할 사항!

1

당신이 꺼낼 수있는 경우이 :

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

그런 다음 일반 텍스트로 이메일을 보내는 그들은 자동으로 스팸으로 감지되지 않습니다.

+0

답장을 보내 주셔서 감사합니다. 그리고 그것은 이것이 하나의 논리적 인 해결책이 될지라도 나는 메일 중 하나에서 테이블을 사용하고 html 기능을 손상시키지 않고 유지하려고합니다. 분명히 구글이 스팸이라고 생각하는 html 메일이라는 사실 이외의 다른 이유가있을 것입니다. –

관련 문제