Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Invio email e css

  1. #1

    Invio email e css

    ciao!

    devo inviare delle email con del CSS ben preciso.
    per l'invio delle email uso phpmailer, mandandole con la funzione MsgHTML, che mi assicura di inviarle in formato HTML.
    il testo che invio è una cosa del genere:
    Codice PHP:
                $html = <<<HTML
                    <!DOCTYPE html>
                    <html lang="it">
                        <head>
                            <meta charset="utf-8">
                            <title>Ordine</title>
                            <style>
                                .table-bordered { border: 1px solid #DDD; }
                                .table { width: 100%;max-width: 100%;margin-bottom: 20px; }
                                table { background-color: transparent; }
                                table { border-spacing: 0px;border-collapse: collapse; }
                                .table > caption + thead > tr:first-child > td, .table > caption + thead > tr:first-child > th,
                                .table > colgroup + thead > tr:first-child > td, .table > colgroup + thead > tr:first-child > th, 
                                .table > thead:first-child > tr:first-child > td, .table > thead:first-child > tr:first-child > th { border-top: 0px none; }
                                table.table-bordered thead th, table.table-bordered thead td { border-left-width: 0px;border-top-width: 0px; }
                                .table-bordered > thead > tr > td, .table-bordered > thead > tr > th { border-bottom-width: 2px; }
                                .table-bordered > tbody > tr > td, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > td, 
                                .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > thead > tr > th { border: 1px solid #DDD; }
                                .table > thead > tr > th { vertical-align: bottom;border-bottom: 2px solid #DDD; }
                                .table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td, .table > tfoot > tr > th, 
                                .table > thead > tr > td, .table > thead > tr > th { padding: 8px;line-height: 1.42857;vertical-align: top;border-top: 1px solid #DDD; }
                                th { text-align: left; }
                            </style>
                        </head>
                    <body>
                    
    $table
                    <hr><br>
                    <table class="table table-bordered" style="width: 250px;">
                        <tr>
                            <td>Tot Qta</td>
                            <td>Tot Imp</td>
                        </tr>
                        <tr>
                            <td>
    $qtaTotale</td>
                            <td>
    $importoTotale</td>
                        </tr>
                    </table>
                    <br><hr><br>
                    
    $note
                    </body>
                    </html>
    HTML; 
    dove $table è una table html che delle classi per impostare il css.
    ma l'email arriva senza css, e se vado a vedere, i vari cass vengono levati.
    come posso fare?

    o meglio, dove sto sbagliando??

  2. #2
    ho levato tutte le classi.
    scritto alcune regole direttamente inline nel tag.
    e adesso funziona tutto.

    quindi diciamo che in parte ho risolto, ma lo trovo molto scomodo questo modo.
    se avete qualche consiglio è bene accetto!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.