Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it
    Registrato dal
    Jan 2011
    Messaggi
    360

    Problema accentate ricezione modulo

    Salve ragazzi,

    con il seguente codice
    Codice PHP:
    <?php
    // L'INDIRIZZO DEL DESTINATARIO DELLA MAIL
    $to "info@sito.it";

    $from stripslashes($_REQUEST['fromname'])."<".stripslashes($_REQUEST['fromemail']).">";

    /* Per inviare email in formato HTML, si deve impostare l'intestazione Content-type. */
    $intestazioni  "MIME-Version: 1.0\r\n";
    $intestazioni .= "Content-type: text/html; charset=UTF-8\r\n";

    // IL SOGGETTO DELLA MAIL
    $subject "Modulo contatti";

    // COSTRUZIONE DEL CORPO DEL MESSAGGIO
    $body "Modulo contatti:\n\n";
    $body .= "Nome: " trim(stripslashes($_POST["nome"])) . "\n";
    $body .= "Cognome: " trim(stripslashes($_POST["cognome"])) . "\n";
    $body .= "E-mail: " trim(stripslashes($_POST["email"])) . "\n";
    $body .= "Oggetto: " trim(stripslashes($_POST["oggetto"])) . "\n";
    $body .= "Messaggio: " trim(stripslashes($_POST["messaggio"])) . "\n";

    // INTESTAZIONI SUPPLEMENTARI
    $headers "From: " stripslashes($_REQUEST['nome']) ." "stripslashes($_REQUEST['cognome'])."<".stripslashes($_REQUEST['email']).">";

    // INVIO DELLA MAIL
    if(@mail($to$subject$body$headers$intestazioni)) { // SE L'INOLTRO E' ANDATO A BUON FINE...

    header("location: [url]http://www.sito.it/ok.html[/url]");

    // echo "L'e-mail e' stata inoltrata con successo.";

    } else {// ALTRIMENTI...

    // echo "Si sono verificati dei problemi nell'invio della e-mail.";

    header("location: [url]http://www.sito.it/errore.html[/url]");

    }

    ?>
    riesco ad inviare i dati inseriti in un modulo contatti, ma alla ricezione in posta ho problemi con le accentate, come risolvere?

  2. #2
    Utente bannato L'avatar di Ht28
    Registrato dal
    May 2006
    Messaggi
    1,544
    Che problemi ti da? Dove? Spiega meglio

    Comunque sostituisci UTF-8 con questo
    Codice PHP:
    "content-type: text/html; charset=iso-8859-1\\r\\n"

  3. #3
    Utente di HTML.it
    Registrato dal
    Jan 2011
    Messaggi
    360
    Originariamente inviato da Ht28
    Che problemi ti da? Dove? Spiega meglio

    Comunque sostituisci UTF-8 con questo
    Codice PHP:
    "content-type: text/html; charset=iso-8859-1\\r\\n"
    Guarda, ho messo come dici tu ma non andava ugualmente, poiché la pagina del mio form è UTF-8 ho letto solo poco fa che nel tag form dovevo mettere accept-charset="iso-8859-1" ed ora i messaggi che ricevo in posta non hanno problemi di accentate. Grazie comunque del tuo suggerimento iniziale.

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.