Visualizzazione dei risultati da 1 a 3 su 3

Discussione: l'allegato nn arriva

  1. #1

    l'allegato nn arriva

    allora ho creato un form in html x l'invio di e-mail comprensive di allegati! ora l'e-mail senza inviare l'allegato arriva! se inserisco l'allegato arriva cmq ma l'allegato nn c'è!inoltre viene generato l'errore evidenziato all'interno del codice

    Codice PHP:
    /*                _build_headers()
     *                 [INTERNAL] build the mail headers
     */

    function _build_headers() {

            
    // creation du header mail

            
    $this->headers"From: $this->from\n";

            
    $this->toimplode", "$this->sendto );

            if( 
    count($this->acc) > ) {
                    
    $this->ccimplode", "$this->acc );
                    
    $this->headers .= "CC: $this->cc\n";
            }

            if( 
    count($this->abcc) > ) {
                    
    $this->bccimplode", "$this->abcc );
                    
    $this->headers .= "BCC: $this->bcc\n";
            }

            if( 
    $this->organization != ""  )
                    
    $this->headers .= "Organization: $this->organization\n";

            if( 
    $this->priority != "" )
                    
    $this->headers .= "X-Priority: $this->priority\n";
    }



    /*
     *                _build_attachement()
     *                internal use only - check and encode attach file(s)
    */

    function _build_attachement() {

            
    $this->boundary"------------" md5uniqid("myboundary") ); // TODO : variable bound

            
    $this->headers .= "MIME-Version: 1.0\nContent-Type: multipart/mixed;\n boundary=\"$this->boundary\"\n\n";
            
    $this->fullBody "This is a multi-part message in MIME format.\n--$this->boundary\nContent-Type: text/plain; charset=us-ascii\nContent-Transfer-Encoding: 7bit\n\n" $this->body ."\n";
            
    $sepchr(13) . chr(10);

            
    $ata= array();
            
    $k=0;

            
    // for each attached file, do...
            
    for( $i=0$i sizeof$this->aattach); $i++ ) {

                    
    $filename $this->aattach[$i];
                    
    $basename basename($filename);
                    
    $ctype $this->actype[$i];        // content-type
                    
    $disposition $this->adispo[$i];

                    if( ! 
    file_exists$filename) ) {
                            echo 
    "[COLOR=orangered]Class Mail, method attach : file $filename can't be found[/COLOR] "; exit;
                    }
                    
    $subhdr"--$this->boundary\nContent-type: $ctype;\n name=\"$basename\"\nContent-Transfer-Encoding: base64\nContent-Disposition: $disposition;\n  filename=\"$basename\"\n";
                    
    $ata[$k++] = $subhdr;
                    
    // non encoded line length
                    
    $lineszfilesize$filename)+1;
                    
    $fpfopen$filename'r' );
                    
    $database64_encode(fread$fp$linesz));
                    
    fclose($fp);
                    
    $ata[$k++] = chunk_split$data );
            }

            
    $this->attachmentimplode($sep$ata);
    }


    // class Mail 
    cosa sbaglio xkè l'allegato nn arriva?

  2. #2
    1 risposta per piacere

  3. #3
    Moderatore di Server Apache L'avatar di marketto
    Registrato dal
    Sep 2001
    Messaggi
    5,858
    ciao, usa phpmailer:
    http://phpmailer.sourceforge.net/



    think simple think ringo

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.