エックスサーバーで 空メール実行PHP
エックスサーバーを借りています。
PHPの勉強を始めたばかりの初心者です。
空メールを送り、定型文を自動返信させたいのですが、うまくいきません。
どなたか何処が間違っているのが、教えていただけないでしょうか?
《設定内容》
エックスサーバーのメール振り分けは、
条件(キーワード) ○○○@△△.△△△.jp
条件(場所) あて先
条件(一致) 内容を含む
処理方法 | /usr /bin/php5 /home/サーバーID/ドメイン/public_html/empty_mail.php
【.htaccess】
php_value register_globals 1
php_value magic_quotes_gpc 0
php_value session.use_cookies 0
php_value session.use_trans_sid 0
php_value output_buffering 1
php_value output_handler mb_output_handler
php_value default_charset EUC-JP
php_value mbstring.language Japanese
php_value mbstring.internal_encoding EUC-JP
php_value mbstring.http_input EUC-JP
php_value mbstring.http_output EUC-JP
php_value mbstring.encoding_translation 1
php_value mbstring.detect_order auto
php_value mbstring.substitute_character none
【php.ini】
safe_mode = off
max_input_time = 60
output_buffering = none
safe_mode_exec_dir = none
upload_max_filesize = 10M
variables_order = EGPCS
dbx.colnames_case = lowercase
HTTP input encoding translation = on
mbstring.detect_order = auto
mbstring.encoding_translation = on
mbstring.http_input = auto
mbstring.http_output = SJIS
mbstring.internal_encoding = EUC-JP
mbstring.language = Japanese
session.save_path = /var/lib/php/session
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
【empty_mail.php】
#!/usr/bin/php5
<?php
require_once 'Mail/mail.php';
require_once 'Mail/mimeDecode.php';
$source = file_get_contents("php://stdin");
if(!$source){
exit();
}
$decoder = new Mail_mimeDecode($source);
$structure = $decoder->decode($params);
$from = $structure->headers['from'];
$from = mb_decode_mimeheader($from);
$from = mb_convert_encoding($from, mb_internal_encoding(), 'auto');
if (preg_match( '/<(.*?)>$/', $from, $match) {
$from = $match[1];
}
$from = trim($from);
$from = strtolower($from);
$recipients = $from;
$new_from = '○○○@△△.△△△.jp';
$subject = '==';
$body = '===本文====';
$headers = array();
$headers['From'] = $new_from;
$headers['To'] = $recipients;
$headers['Subject'] = $subject;
$headers['Sender'] = $new_from;
$mail = Mail::factory('sendmail');
$result = $mail->send($recipients, $headers, $body);
ini_set('log_errors', '1');
ini_set('error_log', 'エラーログのパス');
?>
【携帯へ帰ってきたエラー内容】
This is the Postfix program at host sv○○○.xserver.jp.
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to <postmaster>
If you do so, please include this problem report. You can
delete your own text from the attached returned message.
The Postfix program
<○○○@△△.△△△.jp>: Command died with status 126: "/usr/bin/maildrop".
Command output: sh: /usr: is a directory
問題だらけだと思うのですが、どこをどう直していいのか
わかりません。お願いします。