私には奇妙なことが起こっています。私は、mail()
関数を使用してHTMLメールを送信しようとしていますが、ここで運がありません。コードの一部を文字通りコピー&ペーストしても、機能しません。私は間違って何をしていますか?PHPメールを使用してHTMLメールを送信できませんでした。
$message = "<html><body>";
$message .= "<table rules='all' style='border-color: #666;' cellpadding='10'>";
$message .= "<tr style='background: #eee;'><td><strong>Name:</strong> </td></tr>";
$message .= "<tr><td><strong>Email:</strong> </td></tr>";
$message .= "</table>";
$message .= "</body></html>";
$to = '[email protected]';
$subject = 'Website Change Reqest';
$headers = "From: " . $email . "\r\n";
$headers .= "Reply-To: ". $email . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
if (mail($to, $subject, $message, $headers)) {
echo 'Your message has been sent.';
} else {
echo 'There was a problem sending the email.';
}
そして、これは私の電子メールが...どのように見えるかです::ここで私が使用したコードの一部です
Reply-To: [email protected]
MIME-Version: 1.0
Content-Type: text/html; charset=ISO-8859-1
Message-Id: <[email protected]>
Date: Mon, 4 Jul 2011 01:45:51 +0200 (CEST)
<html><body><table rules="all" style="border-color: #666;" cellpadding="10"><tr style='background: #eee;'><td><strong>Name:</strong> </td></tr><tr><td><strong>Email:</strong> </td></tr><tr><td><strong>Type of Change:</strong> </td></tr><tr><td><strong>Urgency:</strong> </td></tr><tr><td><strong>URL To Change (main):</strong> </td></tr><tr><td><strong>NEW Content:</strong> </td></tr></table></body></html>
は私が間違って何をしますか?
あなたは、オペレーティングシステムを使用しないPHPでHTMLメールを送信することに役立ちリンクです? –
Mac OS X 10.7と私の電子メールクライアントはSparrowです – Michiel