PHPMailer和Outlook电子邮件客户端

时间:2017-02-07 02:32:23

标签: php html email outlook

我制作了一个网络程序,并使用PHPMailer向客户发送电子邮件。

当我使用网络邮件(例如Gmail或Yahoo网页)打开邮件时,电子邮件看起来就像我想要的那样。

但是,当我通过Outlook电子邮件客户端打开它时,除了我的文字之外,它没有显示任何内容。

我在电子邮件中使用HTML代码..这里是电子邮件的HTML代码..

<html lang="en">
    <meta name="format-detection" content="date=no">
    <meta name="format-detection" content="email=no">
    <head>
        <script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
        <title><?php echo $title?></title>
        <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
        <style type="text/css">
            body
            {
                font-family: 'Open Sans', sans-serif;
                -webkit-print-color-adjust: exact;
            }

            .kotakUtama {
              z-index: 1;
              /*margin: 0 auto;*/
              width: 520px;

              /*padding-top: 30px;*/
              background: url("<?php echo base_url()?>assets/img/background/<?php echo $gambar?>.jpg");
              height: <?php echo $height?>px;
            }

            .headerVoucher
            {
                margin-top: 40px;
                width:100%;
                display:inline-block;
                text-align:center;
                font-size: 30pt;
            }

            .wordVoucher
            {
                margin-top: 20px;
                width:100%;
                display:inline-block;
                text-align:center;
                font-size: 12pt;
            }

            .kotakVoucher
            {
                margin-top: <?php echo $margin?>px;
                margin-left: 25%;
                width:50%;
                font-weight: bolder;
                display:inline-block;
                text-align:center;
                font-size: 20pt;
                color: <?php echo $color?>;
            }

            .logoBrand
            {
                /*position:fixed;*/
                z-index:10;
                display: block;
                margin: auto;
            }
        </style>

        <script>
            $(document).ready(function(){
                <?php 
                if($status == 'printVoucher')
                {
                    // echo("Masuk");
                ?>
                    window.print();
                <?php
                }
                ?>
            })
        </script>
    </head>

    <body>
        <!-- <div class="container" id="nonCanvas" style="padding-left:30px;padding-right:30px;">
            <div class="row" style="height:5vh;">
            </div>

            <div class="row" style="height:80vh;padding:0;">
                <div class="col-md-offset-3 col-md-6">   -->
                <table style="margin: 0 auto">
                    <tr style="height:20px;">
                        <td></td>
                    </tr>
                    <tr>        
                        <td width="520px">  
                            <div class="kotakUtama">
                                <!--<img src="<?php //echo base_url()?>assets/img/logo/<?php //echo $gambar?>.png" class="logoBrand">-->
                                <?php if($gambar <> "URBANICON" && $gambar <> "FOSSIL"){?>
                                <span class="headerVoucher">Terima Kasih !</span>
                                <span class="wordVoucher">
                                    Kami sangat mengapresiasi bantuan Anda sehingga kami
                                    <br/>
                                    bisa menjadi lebih baik. Sebagai apresiasi atas bantuan
                                    <br/>
                                    Anda, kami memberikan potongan Rp100.000 untuk
                                    <br/>
                                    pembelian Anda berikutnya dalam 30 hari.
                                    <br/>
                                    Kode voucher Anda :
                                </span>
                                <?php } ?>
                                <span class="kotakVoucher">
                                    <?php echo $voucher;?>
                                </span>
                                <?php if($gambar <> "URBANICON" && $gambar <> "FOSSIL"){?>
                                <span class="wordVoucher">
                                    Kode ini berlaku untuk 1 kali pemakaian dan harus
                                    <br/>
                                    digunakan dalam 30 hari
                                </span>
                                <?php } ?>
                                <!-- <span class="wordVoucher">
                                    Untuk melihat koleksi <?php //echo $brand;?> lainnya,
                                    <br/>
                                    kunjungi <?php //echo $webBrand;?>
                                </span> -->
                            </div>
                        </td>
                    </tr>
                </table>
                <!-- </div> 
            </div>
        </div> -->
    </body>
</html>

是否有任何错误的代码导致我的HTML电子邮件无法在Outlook上正常显示?

1 个答案:

答案 0 :(得分:0)

要在Outlook中使用背景图片,请参阅Bulletproof background images

相关问题