Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente bannato
    Registrato dal
    Jun 2003
    Messaggi
    3,657

    email e posta indesiderata

    questa classe permette di inviare email in formato html...la cosa che mi stupisce è che non risolve il problema della posta spam su hotmail e yahoo. Cosa dovrei modificare affinché si risolva tale problema?

    Grazie e ciao

    Codice PHP:
    class multipartmail{
         var 
    $header;
         var 
    $parts;
         var 
    $message;
         var 
    $subject;
         var 
    $to_address;
         var 
    $boundary;

         function 
    multipartmail($src$dest$sub){
             
    $this->to_address $dest;
             
    $this->subject $sub;
             
    $this->parts = array("");
             
    $this->boundary "------------" md5(uniqid(time()));
             
    $this->header "From: $src\r\n" .
                             
    "MIME-Version: 1.0\r\n" .
                             
    "Content-Type: multipart/related;\n" .
                             
    " boundary=\"" $this->boundary "\"\r\n" .
                             
    "X-Mailer: PHP/" phpversion();
         }

         function 
    addmessage($msg ""$ctype "text/plain"){
             
    $this->parts[0] = "Content-Type: $ctype; charset=ISO-8859-1\r\n" .
                               
    "Content-Transfer-Encoding: 7bit\r\n" .
                               
    "\n" $msg;
                               
    //chunk_split($msg, 68, "\n");
         
    }

         function 
    addattachment($file$ctype){
             
    $fname substr(strrchr($file"/"), 1);
             
    $data file_get_contents($file);
             
    $i count($this->parts);
             
    $content_id "part$i." sprintf("%09d"crc32($fname)) . strrchr($this->to_address"@");
             
    $this->parts[$i] = "Content-Type: $ctype; name=\"$fname\"\r\n" .
                               
    "Content-Transfer-Encoding: base64\r\n" .
                               
    "Content-ID: <$content_id>\r\n" .
                               
    "Content-Disposition: inline;\n" .
                               
    " filename=\"$fname\"\r\n" .
                               
    "\n" .
                               
    chunk_splitbase64_encode($data), 68"\n");
             return 
    $content_id;
         }

         function 
    buildmessage(){
             
    $this->message "This is a multipart message in mime format.\n";
             
    $cnt count($this->parts);
             for(
    $i=0$i<$cnt$i++){
               
    $this->message .= "--" $this->boundary "\n" .
                                 
    $this->parts[$i];
             }
         }

         
    /* to get the message body as a string */
         
    function getmessage(){
             
    $this->buildmessage();
             return 
    $this->message;
         }

         function 
    sendmail(){
             
    $this->buildmessage();
             
    mail($this->to_address$this->subject$this->message$this->header);
         }
       } 

  2. #2
    Utente bannato
    Registrato dal
    Jun 2003
    Messaggi
    3,657
    up

  3. #3
    Utente bannato
    Registrato dal
    Jun 2003
    Messaggi
    3,657
    Originariamente inviato da FinalFantasy
    up

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.