Visualizzazione dei risultati da 1 a 5 su 5
  1. #1

    [ php & html mail] - Anomalia

    Per mantenere lo standard w3c devo sostituire € con
    Codice PHP:
     // € 
    inserendo il sostituto si verificano degli errori anomali nell’html
    anomali in quanto mai ricorrenti avvolte elimina la chiusura del td “>” a volte si mangia
    il tag align inserendo aign.
    Credo sia dovuto dall’ & oppure dal ; o dallo #

    Come posso risolvere
    Codice PHP:
    <?php
    $messaggio 
    "
    <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
    <html>
    <head>
    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
    <title>Test Mail</title>
    <style type=\"text/css\">
    <!--
    body,td,th {
        font-family: Verdana, Arial, Helvetica, sans-serif;
        font-size: 11px;
    }
    .td_title {
        background-color: #CCCCCC;
    }
    -->
    </style>
    </head>
    <body>
    <center>
        <table width=\"580\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">
            <tr>
                <td colspan=\"5\" align=\"center\" class=\"td_title\">[b]Dettaglio ordine[/b]</td>
            </tr>
            <tr align=\"center\" valign=\"middle\">
                <td>[b]Cod.[/b]</td>
                <td>[b]Articolo[/b]</td>
                <td>[b]Qta. Ord[/b]</td>
                <td>[b]Prz. Unit.[/b]</td>
                <td>[b]Prezzo[/b]</td>
            </tr>
    "
    ;
        
    $valore_1 "AB123";
        
    $valore_2 "Test Articolo";
        
    $valore_3 "1";
        
    $valore_4 120;
        
    $valore_5 120;
        
    //-------------------------------------------------------------------------
        // € €
        //  spazio
    $messaggio .= "
            <tr align=\"left\">
                <td>"
    .$valore_1."</td>
                <td>"
    .$valore_2."</td>
                <td align=\"center\">"
    .$valore_3."</td>
                <td>€"
    .$valore_4."</td>
                <td>€"
    .$valore_5."</td>
            </tr>
    "
    ;
        
    //---------------------------------------------------------------------
        
    $trasporto 10;
        
    $totale 130;
        
    //---------------------------------------------------------------------
    $messaggio .= "
            <tr>
                <td colspan=\"5\" align=\"right\" valign=\"middle\">Trasporto€" 
    $trasporto ."</td>
            </tr>
            <tr>
                <td colspan=\"5\" align=\"right\" valign=\"middle\">Totale€" 
    $totale ."</td>
            </tr>
        </table>
    "
    ;
    $messaggio .= "
    </center>
    </body>
    </html>
    "
    ;
    //---------------------------------------------------------------------------|
    //Per inviare email in formato HTML
    //---------------------------------------------------------------------------|
    $mittente "test@mailtest.com"// mittente 
    $e  "test@mailtest.com" ", " // destinatari
    $e .= "$mittente", " ;
    $e .= "test@mailtest.com";
    $ogg="Ordine Merce"// oggetto
    $reply="test@mailtest.com"// risposta

    // .............
    $intestazioni "From: $mittente\nReply-To: $reply\nX-Mailer: Sismail Web Email Interface\nMIME-version: 1.0\nContent-type: multipart/mixed;\n boundary=\"Message-Boundary\"\nContent-transfer-encoding: 7BIT"
    $body_top "--Message-Boundary\n"
    $body_top .= "Content-type: text/html; charset=iso-8859-1\n"
    $body_top .= "Content-description: Mail message body\n\n"
    $msg_body $body_top $messaggio;

    // INVIO DELLA MAIL
    if(@mail($e,$ogg,$msg_body$intestazioni)) {
        echo 
    "<center>La mail è stata inoltrata con successo.".date("D M j G:i:s T Y")."</center>
    "
    ;
        die();

    } else {
    // ALTRIMENTI...
        
    echo "Si sono verificati dei problemi nell'invio dell'ordine. -- ".date("D M j G:i:s T Y"." -- ");
        die();
    }
    //---------------------------------------------------------------------------|
    ?>
    cichity74

  2. #2
    up

  3. #3
    Utente di HTML.it L'avatar di natron
    Registrato dal
    Apr 2001
    Messaggi
    129
    stesso problema
    UP UP

  4. #4
    Utente di HTML.it L'avatar di natron
    Registrato dal
    Apr 2001
    Messaggi
    129
    vai con questi headers:

    $header="From: $nome $cognome\r\n";
    $header.="Return-Path: $email\r\n";
    $header.="Reply-To: $email\r\n";
    $header.="X-MSMail-Priority: High\r\n";
    $header.="X-MimeOLE: Php sender html email by On Air\r\n";
    $header.="MIME-Version: 1.0\r\n";
    $header.="Content-Type: multipart/alternative;\r\n";
    $header.="boundary='==Multipart_Boundary_xc75j85x' \r\n";
    $header.="--==Multipart_Boundary_xc75j85x\r\n";
    $header.="Content-Type: text/plain; charset='iso-8859-1'\r\n";
    $header.="Content-Transfer-Encoding: 7bit\r\n";
    $header.="--==Multipart_Boundary_xc75j85x\r\n";
    $header.="Content-Type: text/html; charset='iso-8859-1'\r\n";
    $header.="Content-Transfer-Encoding: 7bit\r\n";
    $header.="--==Multipart_Boundary_xc75j85x--\r\n";

  5. #5
    Ho notato che mantenendo i mime del mio esempio in locale con php 4.3.3
    da errore invece in remoto con php 4.3.5 tutto ok

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 © 2024 vBulletin Solutions, Inc. All rights reserved.