manoloweb, a partir de esta línea ya me aparece todo en rojo, y me dice que el código está incorrecto. mira a ver que está mal por favor.
Código PHP:
if (eregi('image', $this->adjuntos[$key][tipo]) && eregi('<img.*src=[\"|'](' . $this->adjuntos[$key][nombre] . ')["|'].*>', $this->mail_html)){
$img_id = md5($this->adjuntos[$key][nombre]) . ".nxs@mimemail";
$this->mail_html = eregi_replace('(<img.*src=[\"|'])(' . $this->adjuntos[$key][nombre] . ')([\"|'].*> )', '\1cid:' . $img_id . '\3', $this->mail_html);
$this->adjuntos[$key][embebido] = $img_id;
$this->adjuntos_img[] = $this->adjuntos[$key][nombre];
}
}
}
}
/*
* bool valida_correo(string $correo);
* Funcion encargada de validar si la direccion de correo es
* valida 'sintacticamente'
*/
function valida_correo($correo){
if (ereg('^[-!#$%&'*+\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+.'.'[-!#$%&'*+\./0-9=?A-Z^_`a-z{|}~]+$',$correo)){
return true;
}
$this->debug("Correo no válido sintacticamente ($correo)");
return false;
}
/*
* string revisar_mime(string $nombre);
* Funcion que trata de determinar el tipo MIME por el nombre
* de archivo mandado, en caso de no encontrar se regresa el
* predeterminado
*/
function revisar_mime($nombre){
$ext_array = explode(".", $nombre);
if (($ultimo = count($ext_array) - 1) != 0){
$ext = $ext_array[$ultimo];
foreach($this->tipos_mime as $key => $valor){
if ($ext == $key){
return $valor;
}
}
}
return "application/octet-stream";
}
/*
* int abrir_archivo(string $archivo);
* Abre el conteni??do de una archivo y lo devuelve
* $archivo - Ruta donde se encuentra el archivo a abrir
*/
function abrir_archivo($archivo){
if($fp = fopen($archivo, 'r')){
$regresar = fread($fp, filesize($archivo));
fclose($fp);
return $regresar;
}
return false;
}
/*
* void debug(string $msg);
* Funcion para el manejo de errores de la clase.
*/
function debug($msg){
if ($this->msg_error == "si"){
echo "<br><b>Error:</b> " . $msg . "<br>";
}
elseif ($this->msg_error == "halt"){
die ("<br><b>Error:</b> " . $msg . "<br>");
}
return false;