前提・実現したいこと
FuelPHPのEmailパッケージを利用して、添付ファイル付きメールを送信するシステムを作成しました。
発生している問題・エラーメッセージ
受信したメールクライアントのうちiPhoneの標準メールアプリだけは添付ファイルが存在しない状態となりました。
本文や件名、FROM、TOは正しく表示されています。
また、メールアプリのリスト部分に添付ファイル付きであるクリップマークも表示されています。
しかし、メールを開くと添付ファイルが存在していないメールと同様の表示です。
通常であれば、添付された画像はサムネイルで表示され、PDF等のファイルはファイルアイコンが表示されているはずです。
該当のソースコード
PHP
1$email = Email::forge(); 2$email->from($from, $name); 3$email->to($to); 4$email->reply_to($reply); 5$email->subject($subject); 6$body = View::forge('email/attach_test'); 7$email->body($body); 8$email->attach($filepath1,false,null,null,$filename1); 9$email->attach($filepath2,false,null,null,$filename2); 10$email->attach($filepath3,false,null,null,$filename3); 11$email->send();
試したこと
以下のメールクライアントで受信した場合は正しく添付ファイルを開くことが出来ました。
・PC(Windows 10) Becky! 2.73
・PC(Windows 10) https://mail.google.com/ (Firefox56.0.2)
・iPhone(iOS 12.0.1) Gmailアプリ
補足情報(FW/ツールのバージョンなど)
Amazon Linux 2
Apache 2.4.34
Postfix 2.10.1
PHP7.2
FuelPHP1.8.1
Emailパッケージの設定
return array( /** * Default settings */ 'defaults' => array( /** * Mail useragent string */ 'useragent' => 'Email Send System', /** * Mail driver (mail, smtp, sendmail, noop) */ 'driver' => 'mail', /** * Whether to send as html, set to null for autodetection. */ 'is_html' => null, /** * Email charset */ 'charset' => 'utf-8', /** * Wether to encode subject and recipient names. * Requires the mbstring extension: http://www.php.net/manual/en/ref.mbstring.php */ 'encode_headers' => true, /** * Ecoding (8bit, base64 or quoted-printable) */ 'encoding' => '8bit', /** * Email priority */ 'priority' => \Email::P_NORMAL, /** * Default sender details */ 'from' => array( 'email' => false, 'name' => false, ), /** * Default return path */ 'return_path' => false, /** * Whether to validate email addresses */ 'validate' => true, /** * Auto attach inline files */ 'auto_attach' => true, /** * Auto generate alt body from html body */ 'generate_alt' => true, /** * Forces content type multipart/related to be set as multipart/mixed. */ 'force_mixed' => false, /** * Wordwrap size, set to null, 0 or false to disable wordwrapping */ 'wordwrap' => 76, /** * Path to sendmail */ 'sendmail_path' => '/usr/sbin/sendmail', /** * SMTP settings */ 'smtp' => array( 'host' => '', 'port' => 25, 'username' => '', 'password' => '', 'timeout' => 5, ), /** * Newline */ 'newline' => "\n", /** * Attachment paths */ 'attach_paths' => array( // absolute path '', // relative to docroot. DOCROOT, ), ), /** * Default setup group */ 'default_setup' => 'default', /** * Setup groups */ 'setups' => array( 'default' => array(), ), );
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/11/19 01:30