Como aclaración esta aplicacion funcionaba perfectamente antes de que cambien el servidor, y donde tenia instalado php4 (creo q en el nuevo tiene php5).
Saludos, y espero q puedan ayudarme.
Código PHP:
<?php class local_dirs
{
function local_dirs($site_offset="")
{
global $DOCUMENT_ROOT;
$this->root = $DOCUMENT_ROOT . "/$site_offset/";
$this->sys = $this->root . "sys/";
$this->inc = $this->sys . "inc";
$this->classes = $this->sys . "classes";
$this->lib = $this->sys . "lib";
$this->media = $this->root . "sys/media/";
$this->skins = $this->media . "skins";
$this->images = $this->media . "images";
$this->files = $this->root . "files/";
$this->tmp = $this->files . "tmp";
$this->notas = $this->files . "notas";
}
}
$local_dirs = new local_dirs($offset);
require("$local_dirs->classes/inc.class.virt.mail.php"); ?>
Código PHP:
<?php
class email
{
var $from;
var $subject_generalizer;
function email($from="V",$gen="[VServices]")
{
$this->from=$from;
$this->subject_generalizer=$gen;
}
function sendText($to,$subject,$contenido)
{
//echo "$to<Br> $subject<Br> $contenido<Br>";
mail($to, $this->subject_generalizer.$subject, $this->simpleBoundary($contenido), $this->messageHeader());
}
function sendHtml($to,$subject,$contenido)
{
//echo "$to<Br> $subject<Br> $contenido<Br>";
mail($to, $this->subject_generalizer.$subject, $contenido, $this->messageHeaderHtml());
}
function sendForm($to,$subject,$contenido,$header="",$footer="")
{
$tcontent= "$header\n\nFecha>> ". date("d-m-Y H:i"). " \n";
//var_dump($contenido);
foreach($contenido as $nombre => $contenido) $tcontent.= "[$nombre] $contenido\n";
$tcontent.="\n$footer";
mail($to, $this->subject_generalizer.$subject, $this->simpleBoundary($tcontent), $this->messageHeader());
}
function sendForms($to,$subject,$contenido,$header="",$footer="")
{
$tcontent= "$header\n\nFecha>> ". date("d-m-Y H:i"). " \n";
//var_dump($contenido);
foreach($contenido as $clave => $formulario)
{
$tcontent.= "=$clave================== \n";
foreach($formulario as $nombre => $contenido)
{
$tcontent.= "[$nombre] $contenido\n";
}
}
$tcontent.="\n$footer";
//echo $tcontent;
mail($to, $this->subject_generalizer.$subject, $this->simpleBoundary($tcontent), $this->messageHeader());
}
function messageHeader()
{
$message_headers="From: $this->from\n";
$message_headers.="MIME-Version: 1.0\n";
$message_headers.="Content-type: multipart/alternative; boundary=\"simple boundary\"\n";
$message_headers.="X-Mailer: PHP/" . phpversion() . "\n";
return($message_headers);
}
function messageHeaderHtml()
{
$headers ="From: $this->from\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$message_headers.="X-Mailer: PHP/" . phpversion() . "\n";
return($headers);
}
function simpleBoundary($tcontent)
{
$message_preamble="This is a multi-part message in MIME format.\n\n";
$message_boundary="--simple boundary\n";
$message .= $message_preamble;
$message .= $message_boundary;
$message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding: quoted-printable\n\n";
$message .= $tcontent."\n";
$message .= $message_boundary;
return($message);
}
}
?>