2007년 8월 4일 토요일

일본어로 MAIL 보내기 PHP 소스


일본어로 메일보내기 PHP 소스 중에,
문자열 깨짐도 적고, 서버 영향도 덜 받고,

어디에서나 잘 작동하는 것입니다.

단, mbstring모듈이 장착돼 있는 제약이 따릅니다.


subject = "タイトル てすとー表示、可能性、㈱";

$message = $_POST["message"];



$from = "sender@test.com";

$header = "Content-Type: text/plain;charset=\"iso-2022-jp\" \n";

$headers .= "X-Sender: $from \n";



$address = "test@yahoo.co.jp" ;  // 送り先メールアドレス

mb_language("Ja") ;

mb_internal_encoding("SJIS") ;



if ( $message != "" )

{

if(mb_send_mail($address,$subject,$message,$header))

{

echo "送信完了";

}

else
{

echo "送信に失敗";

}

}