は、ここに私のコードです:Hotmailに電子メールを送信できないのはなぜですか?
それはGmailやヤフー、GMXのために働いていた...しかし、それはHotmailの/ライブ/ MSNのために動作しませんでした$boundary = sha1('whatever');
$headers = 'MIME-Version: 1.0'."\r\n";
$headers .= 'From: "Domainname" [email protected]'."\r\n";
$headers .= 'Reply-to: Domainname <[email protected]>'."\r\n";
$headers .= 'X-Priority: 3'."\r\n";
$headers .= 'X-Mailer: Mail 1.0'."\r\n";
$headers .= 'Subject: '.$subject."\r\n";
$headers .= 'Content-Type: multipart/alternative; boundary="'.$boundary.'"'."\r\n\r\n";
$message = '--'.$boundary."\r\n";
$message .= 'Content-Type: text/plain; charset="utf-8"'."\r\n\r\n";
$message .= $text."\r\n";
$message .= '--'.$boundary."\r\n";
$message .= 'Content-Type: text/html; charset="utf-8"'."\r\n\r\n";
$message .= $html."\r\n";
$message .= '--'.$boundary.'--';
mail($email, $subject, $message, $headers);
。
Gmailのために働いたので、それは私のサーバーとはまったく関係ないと思いますか?
私もちょうどでそれを試してみました:
mail('[email protected]', 'This is a subject', 'This is the body');
同じ問題。それは私の迷惑メールフォルダに送られることさえありません。
OMG、SPFレコードに言及したのは初めてのことです。今すぐ試してみましょう。ありがとう! –
問題はありません:)しかし、あなたはまだ正しいヘッダーが必要です。おそらくphpmailerクラスを使用できますか?これはすべての種類の電子メールのための素晴らしいサポートをしています。 –