昨日、https://teratail.com/questions/184539 で質問させていただいた者です。
要約すると、Qdmail_receiverで受け取ったメール情報について、Gmailアプリで添付画像付きで受信した場合にiOSとAndroidで中身が異なる(Androidの場合にimgタグが入らない)ということでした。
その後、別のロジックで試したところ、どうもQdmail_receiverの原因ではないということが分かりました。具体的には、
$input = file_get_contents("php://stdin"); $structure = mail_mimeDecode($input); foreach ($structure->parts as $part) { foreach ($part->parts as $part_child) { 処理 } }
という処理があり、Gmailアプリで本文を「test」という文字列と添付画像で送信したところ、
$part->parts
の出力にiOSとAndroidで違いがありました。
■iOS
array(2) { [0]=> object(stdClass)#33 (5) { ["headers"]=> array(1) { ["content-type"]=> string(27) "text/plain; charset="UTF-8"" } ["ctype_primary"]=> string(4) "text" ["ctype_secondary"]=> string(5) "plain" ["ctype_parameters"]=> array(1) { ["charset"]=> string(5) "UTF-8" } ["body"]=> string(6) "test " } [1]=> object(stdClass)#34 (5) { ["headers"]=> array(1) { ["content-type"]=> string(26) "text/html; charset="UTF-8"" } ["ctype_primary"]=> string(4) "text" ["ctype_secondary"]=> string(4) "html" ["ctype_parameters"]=> array(1) { ["charset"]=> string(5) "UTF-8" } ["body"]=> string(100) "<div dir="auto">test<div><img src="cid:16a24a4e5c85be0ca571" style="max-width: 100%;"></div></div> " } }
■Android
array(2) { [0]=> object(stdClass)#33 (5) { ["headers"]=> array(1) { ["content-type"]=> string(27) "text/plain; charset="UTF-8"" } ["ctype_primary"]=> string(4) "text" ["ctype_secondary"]=> string(5) "plain" ["ctype_parameters"]=> array(1) { ["charset"]=> string(5) "UTF-8" } ["body"]=> string(6) "test " } [1]=> object(stdClass)#34 (5) { ["headers"]=> array(1) { ["content-type"]=> string(26) "text/html; charset="UTF-8"" } ["ctype_primary"]=> string(4) "text" ["ctype_secondary"]=> string(4) "html" ["ctype_parameters"]=> array(1) { ["charset"]=> string(5) "UTF-8" } ["body"]=> string(28) "<div dir="auto">test</div> " } }
となり、やはり[1]のオブジェクトの["body"]に
iOSの場合はimgタグが入っていますが、Androidには入っていません。
■iOS ["body"]=> string(100) "<div dir="auto">test<div><img src="cid:16a24a4e5c85be0ca571" style="max-width: 100%;"></div></div> " ■Android ["body"]=> string(28) "<div dir="auto">test</div> "
どこに原因があるのか、私にはこれ以上分析ができないので教えていただきたいです。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。