PHP почта не показывает HTML с Gmail - PullRequest
0 голосов
/ 26 октября 2019

отправка почты в outlook работает нормально, но при использовании gmail html не отображается ... здесь код: все работает нормально, когда я отправляю почту в учетную запись outlook, css выполняет эту работу, но теперь, когда я отправляю почту в учетную запись gmail. есть идеи?

$token = bin2hex(random_bytes(100));

      $to = $email;
      $subject = 'Authorize new IP address';

      $headers = "From: " . strip_tags('no-reply@handl.com') . "\r\n";
      $headers .= "Reply-To: ". strip_tags('no-reply@handl.com') . "\r\n";
      $headers .= "MIME-Version: 1.0\r\n";
      $headers .= "Content-Type: text/html; charset=iso-8859-1\r\n";

      ob_start();  ?>
      <html>
      <head>
          <title>Handl IP authorization</title>
      </head>
      <body >
      <div style="font-size=16px;width:400px;background-color:ivory;">

          <p>Hi,</br></br>

          This is to notify you that we have detected a login from an IP address that has not been seen on your account before.
          This will happen if you have a dynamic IP address, which is common.
          </p>
          <p>Here are your log in details:</p>
          </br>

          <p>Email : <?=$email;?> </p>
          <p>Ip Address : <?=$ip_client;?> </p>

          </br>
          <p>Confirm the login, please click the button below:</p>

          <a href="https://handl.com/access/confirm_ip.php?token=<?php echo $token;?>&ip=<?php echo $ip_client;?>">Click Here</a>
          <p>If the link does not work please copy and paste the following link:</p>
          <p>https://handl.com/access/confirm_ip.php?token=<?php echo $token;?>&ip=<?php echo $ip_client;?></p>
          <p>If you can\'t access after this step, please send an email to contact@handl.com</p>
          <p>Thank you!</a>
          </div>
      </body>
      </html>

      <?php  $my_var = ob_get_clean();
      $message = $my_var;




    mail($to, $subject, $message, $headers)
...