###やりたいこと
サクラサーバーでメールを受け取ったらPHPを実行したい。
サーバーはさくらのレンタルサーバーです。
###エラー内容
メールを受け取ることができない。
スクリプトは実行されていません。
よろしくお願いします。
###コード
php
1//.mailfilter 2to "| /usr/local/bin/php -q /home/ユーザー名/www/push.php"
php
1//push.php 2#!/usr/local/bin/php 3<?php 4 5$stdin = file_get_contents('php://stdin'); 6 7require_once dirname(__FILE__) . 'D.php'; 8 9$stdin = file_get_contents('php://stdin'); 10$decoder = new Mail_mimeDecode($stdin); 11$params = array("include_bodies"=>true); 12$structure = $decoder->decode($params); 13 14 15$subject = mb_convert_encoding(mb_decode_mimeheader($structure->headers["subject"]),mb_internal_encoding(), "auto"); 16$bdoy = $structure->body; 17$subjects = mb_convert_encoding(mb_decode_mimeheader($structure->headers["from"]),mb_internal_encoding(), "auto"); 18?>
回答2件
あなたの回答
tips
プレビュー