2012-04-12 9 views
0

私はrackspaceサーバーにcentOS 6をセットアップし、Apache PHP &他のモジュールをインストールしました。 PHPからmail()関数を使用するためにsendmailもインストールしましたが、動作していますが、私は自分のヘッダをmail()に設定できません。CentOS 6のsendmailでメールヘッダーの問題

$to = "[email protected]"; 
$subject = "Hi!"; 
$body = "Hi,\n\nHow are you?"; 


$from = " Team <[email protected]>"; 
$headers = "From: $from\r\n"; 
$headers = "MIME-Version: 1.0\n" ; 
$headers .= "Content-Type: text/html; charset=\"iso-8859-1\"\n"; 

if (mail($to, $subject, $body)) { 
    echo("<p>Message successfully sent!</p>"); 
    } else { 
    echo("<p>Message delivery failed...</p>"); 
    } 

しかし、私はヘッダー "Apache apache @ server"で迷惑メールを取得しています。ヘッダーが設定されていません。 私も "-f emailaddress"を試しましたが、動作しませんでした。

どうすればよいですか?私もsendmailの設定を試してみましたが、まだ解決していません。

Ritesh

答えて

0

ラインに\n\r\nを交換$headers = "From: $from\r\n";