Ci PHP отправлять электронную почту с медиа не работает в мобильном браузере - PullRequest
0 голосов
/ 27 августа 2018

Помогите мне с отправителем электронного письма: я использую codeigniter, как показано ниже:

      <code>
             $text = " <!DOCTYPE html>
                <html lang='en'>
            <head>
                <meta http-equiv='X-UA-Compatible'>
                <meta name='viewport' content='width=device-width, initial-scale=1.0'>
                <style>
                    #body {
                        font-size: 14px;
                    }
                    h1 {
                        color: blue !important;
                    }
                    .colored {
                        color: blue !important;
                    }
                    .hi { color: blue !important; }
                    #hiid  { color: blue !important; }

                    @media screen and (min-width: 500px) {
                        .colored {
                          color: red !important;
                        }
                        h1 {
                          color: red !important;
                        }
                        .hi { color: red !important; }
                        #hiid  { color: red !important; }
                    }
                    @media screen and (max-device-width: 767px), screen and (max-width: 767px) {
                        .colored {
                          color: blue !important;
                        }
                        h1 {
                          color: blue !important;
                        }
                        .hi { color: blue !important; }
                        #hiid  { color: blue !important; }
                    }
                </style>
            </head>
            <body>
                <div id='body'>
                  <h1 class='hi' id='hiid' style='color: #ff00e0;'>Hi Pierce, ".$acak."</h1>
                  <p class='colored'>This text is blue if the window width is below 500px and red otherwise.</p>
                  <p>Jerry</p>
                </div>
            </body>
            </html>";


           $isi_email = $text;
           $config = array(
                'protocol'    => $this->config->item('protocol'),
                'smtp_host'   => $this->config->item('smtp_host'),
                'smtp_port'   => $this->config->item('smtp_port'),
                'smtp_user'   => $this->config->item('smtp_user'),
                'smtp_pass'   => $this->config->item('smtp_pass'),
                'smtp_crypto' => $this->config->item('smtp_crypto'),
                'mailtype'    => 'html'
            );

        $this->email->initialize($config);
        $this->email->set_newline("\r\n");

        and another setting from/to email
        $this->email->message($isi_email);

        $email = $this->email->send();
</code>

, и это результат, если я использую браузер на рабочем столе: в браузере на рабочем столе работает нормально

и этот результат, если я проверяю функцию медиа-запроса, работает хорошо: в браузере dekstop с проверкой медиа-запросов работает нормально

, но если я проверяю на мобильном телефоне, все стили не являются встроенными и не имеют атрибутовЭлемент (class / id) удален. на мобильном экране просмотра медиазапросов не работает. Стиль jus inline

Я проверял консоль при открытии входящих сообщений и получал эту ошибку, но я не знаю, почему.Пожалуйста, помогите введите описание изображения здесь

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...