Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 13
  1. #1

    immagine in fondo a email

    Ciao a tutti riesco ad inviare dal sito una email in formato html tramite form, l'unica cosa e' che non riesco a visualizzare il logo del sito in fondo alla email.


    ho provato ad inserire la parte in grassetto, ma poi non visualizzo nulla....

    questo e' il file che utlizzo : contact.php
    codice:
    <?php
    
    
    // User settings
    //$to = "info@boggialife.com";
    $to = "maurizio.nextart@gmail.com";
    $subject = "Richiesta Prenotazione tavolo.";
    
    // Include extra form fields and/or submitter data?
    // false = do not include
    $extra = array(
        "form_subject"    => true,
        "form_cc"        => true,
        "ip"                => true,
        "user_agent"    => true,
        "newsletter"    => true,
        "tratt"    => true
    );
    
    
    $fileDaInviare = "<img src=\"http://www.nextart.it/public/scrivere/contact/data/logo.jpg\">";   
    // path del file da inviare
    
    // Process
    $action = isset($_POST["action"]) ? $_POST["action"] : "";
    if (empty($action)) {
        // Send back the contact form HTML
        $output = "<div style='display:none'>
        <div class='contact-top'></div>
        <div class='contact-content'>
            <h1 class='contact-title'>Send us a message:</h1>
            <div class='contact-loading' style='display:none'></div>
            <div class='contact-message' style='display:none'></div>
            <form action='#' style='display:none'>
                <label for='contact-name'>*Nome:</label>
                <input type='text' id='contact-name' class='contact-input' name='name' tabindex='1001' />
                <label for='contact-surname'>*Cognome:</label>
                <input type='text' id='contact-surname' class='contact-input' name='surname' tabindex='1001' />
                <label for='contact-name'>*Telefono:</label>
                <input type='text' id='contact-tel' class='contact-input' name='tel' tabindex='1001' />
                <label for='contact-email'>*Email:</label>
                <input type='text' id='contact-email' class='contact-input' name='email' tabindex='1002' />";
    
        if ($extra["form_subject"]) {
            $output .= "
                <label for='contact-subject'>Oggetto:</label>
                <input type='text' id='contact-subject' class='contact-input' name='subject' value='$subject' tabindex='1003' />";
        }
    
        $output .= "
                <label for='contact-message'>*Messaggio:</label>
                <textarea id='contact-message' class='contact-input' name='message' cols='40' rows='4' tabindex='1004'></textarea>
                
    ";
    
        if ($extra["form_cc"]) {
            $output .= "
                <label></label>
                <input type='checkbox' id='contact-cc' name='cc' value='1' tabindex='1005' /> <span class='contact-cc'>Inviami una copia dell'ordine.</span>
                
    ";
        }
    if ($extra["newsletter"]) {
            $output .= "
                <label></label>
                <input type='checkbox' id='contact-cc2' name='newsl' value='Iscrivimi' tabindex='1005' /> <span class='contact-cc'>Newsletter</span>
                
    ";
        }
        if ($extra["tratt"]) {
            $output .= "
                <label></label>
                <input type='checkbox' id='contact-cc3' name='tratt' value='Accosento' tabindex='1005' /> <span class='contact-cc'>*Acconsento al Trattamento dei dati personali</span>
                
    ";
        }
        $output .= "
                <label></label>
                <button type='submit' class='contact-send contact-button' tabindex='1006'>Invia</button>
                <button type='submit' class='contact-cancel contact-button simplemodal-close' tabindex='1007'>Cancella</button>
                
    
                <input type='hidden' name='token' value='" . smcf_token($to) . "'/>
            </form>
        </div>
        <div class='contact-bottom'>Powered by SimpleModal</div>
    </div>";
    
        echo $output;
    }
    else if ($action == "send") {
        // Send the email
        $name = isset($_POST["name"]) ? $_POST["name"] : "";
        $surname = isset($_POST["surname"]) ? $_POST["surname"] : "";
        $tel = isset($_POST["tel"]) ? $_POST["tel"] : "";
        $email = isset($_POST["email"]) ? $_POST["email"] : "";
        $subject = isset($_POST["subject"]) ? $_POST["subject"] : $subject;
        $message = isset($_POST["message"]) ? $_POST["message"] : "";
        $cc = isset($_POST["cc"]) ? $_POST["cc"] : "";
        $news = isset($_POST["newsl"]) ? $_POST["newsl"] : "";
        $tratta = isset($_POST["tratt"]) ? $_POST["tratt"] : "";
        $token = isset($_POST["token"]) ? $_POST["token"] : "";
    
        // make sure the token matches
        if ($token === smcf_token($to)) {
            smcf_send($name, $surname, $email, $tel, $subject, $message, $cc, $news,$tratta,$fileDaInviare);
            echo "Your message was successfully sent.";
        }
        else {
            echo "Unfortunately, your message could not be verified.";
        }
    }
    
    function smcf_token($s) {
        return md5("smcf-" . $s . date("WY"));
    }
    
    // Validate and send email
    function smcf_send($name, $surname, $email, $tel, $subject, $message, $cc, $news,$tratta,$fileDaInviare) {
        global $to, $extra;
    
        // Filter and validate fields
        $name = smcf_filter($name);
        $subject = smcf_filter($subject);
        $email = smcf_filter($email);
        if (!smcf_validate_email($email)) {
            $subject .= " - invalid email";
            $message .= "\n\nBad email: $email";
            $email = $to;
            $cc = 0; // do not CC "sender"
        }
    
        // Add additional info to the message
        //if ($extra["ip"]) {
        //    $message .= "\n\nIP: " . $_SERVER["REMOTE_ADDR"];
        //}
        //if ($extra["user_agent"]) {
        //    $message .= "\n\nUSER AGENT: " . $_SERVER["HTTP_USER_AGENT"];
        //}
    
        // Set and wordwrap message body
        $body = "Da: $name  $surname 
    Telefono: $tel
    ";
        $body .= "Message: $message
    ";
        $body .= "Newsletter: $news
    ";
        $body .= "Trattamento: $tratta
    ";
        $body .= "$fileDaInviare"; 
        $body = wordwrap($body, 70);
    
        // Build header
        $headers = "From: $email\n";
    
        if ($cc == 1) {
            $headers .= "Cc: $email\n";
        }
        $headers .= "X-Mailer: PHP/SimpleModalContactForm";
    
        // UTF-8
        if (function_exists('mb_encode_mimeheader')) {
            $subject = mb_encode_mimeheader($subject, "UTF-8", "B", "\n");
        }
        else {
            // you need to enable mb_encode_mimeheader or risk 
            // getting emails that are not UTF-8 encoded
        }    
        // costruiamo le intestazioni specifiche per il formato HTML
    //$header .= "MIME-Version: 1.0\n";
    //$header .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
    //$header .= "Content-Transfer-Encoding: 7bit\n\n";
        $headers .= "MIME-Version: 1.0\n";
        $headers .= "Content-type: text/html; charset=utf-8\n";
        $headers .= "Content-Transfer-Encoding: quoted-printable\n";
    
        // Send email
        @mail($to, $subject, $body, $headers) or 
            die("Unfortunately, a server issue prevented delivery of your message.");
    }
    
    // Remove any un-safe values to prevent email injection
    function smcf_filter($value) {
        $pattern = array("/\n/","/\r/","/content-type:/i","/to:/i", "/from:/i", "/cc:/i");
        $value = preg_replace($pattern, "", $value);
        return $value;
    }
    
    // Validate email address format in case client-side validation "fails"
    function smcf_validate_email($email) {
        $at = strrpos($email, "@");
    
        // Make sure the at (@) sybmol exists and  
        // it is not the first or last character
        if ($at && ($at < 1 || ($at + 1) == strlen($email)))
            return false;
    
        // Make sure there aren't multiple periods together
        if (preg_match("/(\.{2,})/", $email))
            return false;
    
        // Break up the local and domain portions
        $local = substr($email, 0, $at);
        $domain = substr($email, $at + 1);
    
    
        // Check lengths
        $locLen = strlen($local);
        $domLen = strlen($domain);
        if ($locLen < 1 || $locLen > 64 || $domLen < 4 || $domLen > 255)
            return false;
    
        // Make sure local and domain don't start with or end with a period
        if (preg_match("/(^\.|\.$)/", $local) || preg_match("/(^\.|\.$)/", $domain))
            return false;
    
        // Check for quoted-string addresses
        // Since almost anything is allowed in a quoted-string address,
        // we're just going to let them go through
        if (!preg_match('/^"(.+)"$/', $local)) {
            // It's a dot-string address...check for valid characters
            if (!preg_match('/^[-a-zA-Z0-9!#$%*\/?|^{}`~&\'+=_\.]*$/', $local))
                return false;
        }
    
        // Make sure domain contains only valid characters and at least one period
        if (!preg_match("/^[-a-zA-Z0-9\.]*$/", $domain) || !strpos($domain, "."))
            return false;    
    
        return true;
    }
    
    exit;
    
    ?>
    qualcuno sa dove sbaglio?

    grazie a tutti!!!
    -Nextart.it Graphic Solutions

  2. #2
    nessuno ?????

    please e' importante.......

    grazie ancora
    -Nextart.it Graphic Solutions

  3. #3
    Utente di HTML.it L'avatar di clasku
    Registrato dal
    Aug 2006
    Messaggi
    3,197
    a me sembra tutto corretto...
    però ho provato ad andare al percorso dell'immagine e mi restituisce errore 404, file non trovato...

  4. #4
    scusa ora e' visibile, ma se scarico la mail con outlook ho una croce rossa al posto dell'immagine.....


    -Nextart.it Graphic Solutions

  5. #5
    Utente di HTML.it L'avatar di clasku
    Registrato dal
    Aug 2006
    Messaggi
    3,197
    uhm, nel caso di outlook è un'impostazione di sicurezza che devi disabilitare (in realtà devi consentire la visualizzazione delle immagini sulla singola mail)

    prova a mandare una mail verso una web mail o usa un altro client di posta elettronica: dovrebbe funzionare

    ne sono quasi sicuro perché uso anche io un sistema di quel tipo e funziona

  6. #6
    allora via webmail vedo l'immagine correttamente:


    ma poi quando la stessa email la scrico con il client di posta, dopo aver cliccato la barra


    mi rimane comunque la X rossa....


    con gmail , non vedo ne l'imamgine ne la x rossa.....


    come mai?
    -Nextart.it Graphic Solutions

  7. #7
    Utente di HTML.it L'avatar di clasku
    Registrato dal
    Aug 2006
    Messaggi
    3,197
    hai provato a guardare nel sorgente della mail se c'è qualche stranezza?

  8. #8
    questo e' il messaggio originale con windows mail

    codice:
    X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on plesk-mail.natan.it
    X-Spam-Level: 
    X-Spam-Status: No, score=-95.3 required=4.0 tests=AWL,BAYES_00,HELO_LH_HOME,
        HTML_IMAGE_ONLY_04,HTML_MESSAGE,HTML_MIME_NO_HTML_TAG,MIME_HTML_ONLY,
        RCVD_IN_ALICOM autolearn=ham version=3.2.5
    Received: (qmail 14233 invoked from network); 19 Oct 2010 16:33:48 +0200
    Received: from plesk-win.natan.it (HELO PLESK-WIN.home) (217.73.226.140)
      by mxavas.natan.it with SMTP; 19 Oct 2010 16:33:48 +0200
    Received: from plesk-win ([127.0.0.1]) by home with MailEnable ESMTP; Tue, 19 Oct 2010 16:33:45 +0200
    Date: Tue, 19 Oct 2010 16:33:45 +0200
    Subject: Richiesta Prenotazione tavolo.
    To: maurizio.nextart@gmail.com
    From: maury@nextart.it
    MIME-Version: 1.0
    Content-type: text/html; charset=utf-8
    Content-Transfer-Encoding: quoted-printable
    Cc: maury@nextart.it
    X-Mailer: PHP/SimpleModalContactFormMIME-Version: 1.0
    Content-type: text/html; charset=utf-8
    Content-Transfer-Encoding: quoted-printable
    Message-ID: <43D086DB7D93490282ADF44A8215F637.MAI@home>
    X-Antivirus: avast! (VPS 101019-0, 19/10/2010), Inbound message
    X-Antivirus-Status: Clean
    
    Da: Maurizio  spicuglia 
    Telefono:
    020202020
    Message: ccc
    Newsletter:
    Iscrivimi
    Trattamento: Accosento
    
    l'indirizzo dell'immagine 'e corretto...... non saprei altro.....
    -Nextart.it Graphic Solutions

  9. #9
    Utente di HTML.it L'avatar di clasku
    Registrato dal
    Aug 2006
    Messaggi
    3,197
    mi pare a posto anche a me...
    unica cosa, hai gli header ripetuti, ma non so se possa creare problemi...
    codice:
    MIME-Version: 1.0
    Content-type: text/html; charset=utf-8
    Content-Transfer-Encoding: quoted-printable

  10. #10
    sono ripetuti perche mando la mail sia ad un indirizzo fisso che all'email di chi compila il form, e se non lo ripeto la mail in cc mi arriva in formato testo......



    e' a posto lma l'immagine onn la vedo.......
    -Nextart.it Graphic Solutions

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.