1.
2.
3.
4.
5.
6.
7
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21. |
<?php
//PEARのライブラリ読み込み
require_once("Mail/mimeDecode.php");
//メールソースを標準入力から読み込み
$source = file_get_contents("php://stdin");
if(!$source) {
exit(); // 読み込み失敗
}
//メール解析
$params['include_bodies'] = true;
$params['decode_bodies'] = true;
$params['decode_headers'] = true;
$decoder = new Mail_mimeDecode($source);
$structure = $decoder->decode($params);
$from =
mb_convert_encoding(mb_decode_mimeheader($structure->headers['from']),
mb_internal_encoding(), "auto");
//----------------------------------------//
// 必要な処理はここで行って下さい
//----------------------------------------//
//メール返信
$to = $from;
$title = "空メールの返信(例)";
$body =
"登録が完了しました。\n(実際は何も登録していません。)\n※このメールは配信専用です。\n返信されても対応は出来ませんので、ご了承下さい。";
$from = "From: support@my-server.homelinux.com";
mb_internal_encoding("SJIS");
mb_language("japanese");
mb_send_mail($to, $title, $body, $from);
?> |