コメント |
@DIV
<?
header( "Content-Type: text/html; Charset=utf-8" );
header( "pragma: no-cache" );
header( "Expires: Wed, 31 May 2000 14:59:58 GMT" );
header( "Cache-control: no-cache" );
foreach( $_POST as $Key => $Value ) {
$_POST[$Key] = str_replace("\\\\", "\\", $Value );
$_POST[$Key] = str_replace("\\'", "'", $_POST[$Key] );
$_POST[$Key] = str_replace("\\\"", "\"", $_POST[$Key] );
}
$subject = "件名";
$from_name = "送信元";
$from_address = "<name1@domain1>";
$to_name = "宛先";
$to_address = "<name2@domain2>";
$body = $_GET['text'];
// Windows 用
// ini_set("SMTP", "IPアドレスまたはHOST名" );
// unix では、sendmail を使用します。
// 通常、この URL から信頼されているメールアドレス前提にしているので、
// セキュリティ情報は送る事ができません
// window 環境でもそれは同様なので、同一サーバーにメールサーバー
// を用意するか、COM+basp21でセキュリティ情報を使って送信する必要があります
// mb_send_mail() は、e-mail をエンコードする際にこの設定を使用します
// ※ subject と body のみ
mb_language( "ja" );
// ↓PHP で動作しないと思われる文字エンコーディング
// JIS, SJIS, ISO-2022-JP, BIG-5
// http://www.php.net/manual/ja/mbstring.php4.req.php
// 内部エンコーディングの設定
mb_internal_encoding("EUC-JP");
$subject = mb_convert_encoding( $subject, mb_internal_encoding(), "utf-8" );
$body = mb_convert_encoding( $body, mb_internal_encoding(), "utf-8" );
$body = mb_convert_kana($body,'K',mb_internal_encoding());
// 宛先と差出人は自分でエンコードする必要があります
$to = mb_convert_encoding( $to_name, "JIS", "utf-8" );
$to = "=?ISO-2022-JP?B?" . base64_encode($to) . "?= $to_address";
$from = mb_convert_encoding( $from_name, "JIS", "utf-8" );
$from = "From: =?ISO-2022-JP?B?" . base64_encode($from) . "?= $from_address";
mb_send_mail($to, $subject, $body, $from );
?>
メール送信が終了しました。
@END |