2016-09-30 10 views
1

json(受信メールのmailgunからの投稿要求を受け取ります)を処理します。メールガンで受信メールを処理する問題を処理します。

私はcodeigniterを使用しています。

以下は、私が扱っているjsonの一部です。

}, 
"log-level": "info", 
"timestamp": 1475215276.814206, 
"message": { 
"headers": { 
    "to": "[email protected]", 
    "message-id": "[email protected]om", 
    "from": "User Test <[email protected]>", 
    "subject": "example email for testing" 
}, 
"attachments": [], 
"recipients": [ 
    "[email protected]" 
], 

私はから値$this->input->post('from')対象$this->input->post('subject')にアクセスして問題ありません。

しかし、私は次のコードでへと受信者にアクセスしようとしているが、私は取得していますすべてがNULL値です。

$to = $this->input->post('to'); 

$message_header = $this->input->post('message'); 
$recipients = $message_header->recipients; 
$email = $recipients[0]; 
$email_q = filter_var($email, FILTER_SANITIZE_EMAIL); 

助けがあれば助かります。

答えて

0

次のようにアドレスを指定します。 CodeIgniterので

:PHPで

$this->input->post('recipient'); 

$_POST['recipient']; 
関連する問題