Visualizzazione dei risultati da 1 a 3 su 3

Discussione: Email con allegato

  1. #1

    Email con allegato

    Questo codice permetterebbe in teoria di spedire email html con allegato solo che la parte dell'allegato non mi funge.
    Cioè l'allegato viene spedito.il destinatario vede l'allegato ma non riesce ad aprirlo, come mai?



    <?

    $mess= "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
    <HTML><HEAD>
    <META http-equiv=Content-Type content=\"text/html; charset=iso-8859-1\">
    <STYLE>
    H5 {text-align: justify; text-decoration: none; color: #333333; font-size: 12px; font-family: Arial}
    A:link, A:visited, A:hover { color: #FFcc00 }

    </STYLE>
    </HEAD>
    <BODY bgColor=#ffffff link=#333333 alink=#333333 vlink=#333333>
    <DIV><h5>BLA BLA BLA BLA. Questo è il corpo dell'email; si possono usare tutti i tag html, come se si trattasse di una pagina internet.</h5>
    </BODY></HTML>
    ";


    $e="destinatario@email.it";
    $ogg="Oggetto dell'email";
    $mittente="miaemail@email.com";
    $reply="miaemail@email.com";

    $titolo="allegato.pdf";
    $f="file.pdf";
    $filetype="application/pdf";




    /*Non modificare nulla al di sotto di questa linea*/

    $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\nX-attachments: $titolo";

    $body_top = "--Message-Boundary\n";
    $body_top .= "Content-type: text/html; charset=iso-8859-1\n";
    $body_top .= "Content-transfer-encoding: 7BIT\n";
    $body_top .= "Content-description: Mail message body\n\n";

    $msg_body = $body_top . $mess;

    $filez = fopen($f, "r");
    $contents = fread($filez, filesize($f));
    $encoded_attach = chunk_split(base64_encode($contents));
    fclose($filez);


    $msg_body .= "\n\n--Message-Boundary\n";
    $msg_body .= "Content-type: $filetype; name=\"$titolo\"\n";
    $msg_body .= "Content-Transfer-Encoding: BASE64\n";
    $msg_body .= "Content-disposition: attachment; filename=\"$titolo\"\n\n";
    $msg_body .= "$encoded_attach\n";
    $msg_body .= "--Message-Boundary--\n";

    if(!(@mail($e,$ogg,$msg_body, $intestazioni))){
    print "<H5>Invio della email fallito.</H5>";}
    ?>

  2. #2
    http://codecanyon.net/category/all?ref=Manuelandro
    And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
    memories to be made

  3. #3
    l'ho preso da li il codice...ho scritto anche in quella discussione solo che è andata gia in 3° pagina e mi sa che nessuno risponderà.

    help me!!

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.