Ver Mensaje Individual
  #4 (permalink)  
Antiguo 20/09/2003, 09:26
klulo
 
Fecha de Ingreso: febrero-2003
Ubicación: Guanare
Mensajes: 90
Antigüedad: 23 años, 7 meses
Puntos: 0
Repuesta

Código PHP:
class MailLib{
    var 
$Assumpte;
    var 
$Msg;
    var 
$Cabeceras;
    var 
$EmailResposta;
    var 
$Email;
    var 
$Util;
    
    function 
MailLib(){
        
$this -> Assumpte = "";
        
$this -> Msg = "";
        
$this -> Cabeceras = "";    
        
$this -> Util = new UtilitatLib;
    }
    
    function 
SendMail($Email, $EmailResposta, $Assumpte = "", $Msg = ""){
        
$this -> Email = $Email;
        
$this -> EmailResposta = $EmailResposta;
        
$this -> Assumpte = $Assumpte;
        
$this -> Msg = $Msg; 
        
//Tractament del Missatge.
        
$this -> Msg = $Util -> TractarEmailText($Msg);    
        
        
//Construcció de la capçalera.
        
$this->Cabeceras = MailLib::Cabeceras();    
        
mail($Email, $this->Assupmte, $this->Msg, $this->Cabeceras);
    }
    
    function 
Cabeceras(){
        
//Codificació per enviar mail
        //Cabecera anomenada abans com a Altres
        //Declaració variable
        
$Cabeceras ="";
        
$Cabeceras.="FROM:".$this->EmailResposta."\nX-Mailer: PHP\n";
        
$Cabeceras.="MIME-version: 1.0\n";
        
//<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>

        
$Cabeceras.="Content-Type: text/html; \n ";
        
//$Cabeceras.="Content-type:\" text/html;\"\n ";
        
$Cabeceras.="Content-transfer-encoding: 64BIT\n"; 
        return 
$Cabeceras;
    }
} 
fuente: Josemi