problem sending e-mail with css by phpmailer

2

Galera I put up an email using html and css. The email arrives perfect in several email, but in G-mail the email arrives without the css, ie just the html.

Does anyone know how to solve the problem?

Follow my e-mail code:

$email->Body = "
<html>
<head>
    <style type='text/css'>
        body {
            background-color: #F1F4F9;
        }
        table {
            width: 600px;
            border-collapse: collapse;
            margin-left:auto; 
            margin-right:auto;
        }
        .topo {
            text-align:center;
            background-color: #1E90FF;
            height: 200px;
        }
        .meio {
            padding: 20px;
            background-color: #ffffff;
            height: 300px;
            vertical-align: text-top;
        }
        .fim {
            text-align:center;
            font-weight: bold;
            background-color: #1E90FF;
            height: 50px;
            color: #ffffff;
        }
        .fim a{
            color: #ffffff;
        }
        .titulo {
            text-align:center;
            font-size: 25px;
            font-weight: bold;
        }
    </style>
</head>

<body>

    <table>
        <tr>
            <td class='topo'>
                MEU LOG AQUI
            </td>
        </tr>
        <tr>
            <td class='meio'>
                <p class='titulo'>TITULO</p>
                TEXTO DO E-MAIL  
            </td>
        </tr>
        <tr>
            <td class='fim'>
                Estamos a disposição
            </td>
        </tr>
    </table>

</body>
</html>
";

Am I doing something wrong?

    
asked by anonymous 23.02.2016 / 14:32

1 answer

2

In addition to the CSS tag, you'll also have to put inline styles to work in Gmail.

Some tools can help with conversion:

See also this guide to find out what you can and can not use in each email client.

    
23.02.2016 / 14:44