-1

コードを使用して添付ファイル付きのメールを送信していますが、メール送信ですが、スパムとして送信されます。誰でも理由を推測できますか?これは私のコードです:

$to =    'krishna25@gmail.com';
$subject =   'PHP Mail Attachment Test';
$bound_text =   "jimmyP123";
$bound =    "--".$bound_text."\r\n";
$bound_last =   "--".$bound_text."--\r\n";

$headers =  "From: admin@server.com\r\n";
$headers .= "MIME-Version: 1.0\r\n"
    ."Content-Type: multipart/mixed; boundary=\"$bound_text\"";

$message .= "If you can see this MIME than your client doesn't accept MIME types!\r\n"
    .$bound;

$message .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n"
    ."Content-Transfer-Encoding: 7bit\r\n\r\n"
    ."hey my <b>good</b> friend here is a picture of regal beagle\r\n"
    .$bound;

$file = file_get_contents("http://reality.com/images/ezlogo.png");

$message .= "Content-Type: image/png; name=\"http://reality.com/images/ezlogo.png\"\r\n"
    ."Content-Transfer-Encoding: base64\r\n"
    ."Content-disposition: attachment; file=\"http://reality.com/images/ezlogo.png\"\r\n"
    ."\r\n"
    .chunk_split(base64_encode($file))
    .$bound_last;
if(mail($to, $subject, $message, $headers)) 
{
     echo 'MAIL SENT'; 
} else { 
     echo 'MAIL FAILED';
}
4

2 に答える 2