PHPMailer和Gmail <style>的问题。 不确定Gmail是否仍在处理它

It looks like Gmail has stopped processing the tag. Is anyone facing the same problem? I have even tried the sample code from Google Community, but it is not working.

The emails are being sent through PHPMailer library.

This is the piece of code I am using to test right now, and it hasn't worked. I just got a feedback from a client telling me that their emails all of the sudden are "ugly".

Much appreciated for any feedbacks about it.

$mail = new PHPMailer(true); 

try {

    $mail->SMTPDebug    = 0;
    $mail->isSMTP();
    $mail->Host         = 'smtp.gmail.com';
    $mail->Port         = 587;
    $mail->CharSet  = 'utf-8';
    $mail->Encoding     = 'base64';
    $mail->SMTPSecure   = 'tls';
    $mail->SMTPAuth     = true;
    $mail->Username     = 'my@username';
    $mail->Password     = 'mypassword';

    //Recipients
    $mail->setFrom('sender', 'sendername');
    $mail->addAddress('email@eto.com');

    //Content
    $mail->isHTML(true);
    $mail->Subject = 'Solicitou contato.';
    $mail->Body    = '
        <html>
        <head>
            <style>
                .colored {
                    color: blue;
                }
                #body {
                    font-size: 14px;
               }
            </style>
        </head>
        <body>
            <div id="body">
                <p>Hi Pierce,</p>
                <p class="colored">This text is blue.</p>
                <p>Jerry</p>
            </div>
        </body>
        </html>';

        $mail->send();
        echo "Okay. The message is gone.";

} catch (Exception $e) {
    echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}

Gmail drives a truck through web standards; don’t expect anything to work properly, assuming it even allows your messages as far as the inbox.

Gmail has a history of stripping class and id attributes, meaning that style sheets with selectors that target them do not work. You can have style sheets that target HTML tags, but everything else needs to be inlined. Fortunately there are projects that can help with that, such as emogrifier. Take a look at testing services like Litmus and email on acid to help with cross-client styling.

Well, I don't have an answer, but Google started to process it again. I just got an email from an old client with the correctly formatted design.

Anyway, thanks for the interest on helping me.