Ver Mensaje Individual
  #7 (permalink)  
Antiguo 24/03/2005, 16:00
Avatar de Seppo
Seppo
 
Fecha de Ingreso: marzo-2005
Ubicación: Buenos Aires, Argentina
Mensajes: 1.284
Antigüedad: 19 años, 1 mes
Puntos: 17
Por supuesto que para eso tenés que tener un SMTP...
[PHP] $fecha=date("Y-m-d", time()+60*60*24*31);
$sql = "SELECT * FROM vehiculos WHERE revision='$fecha' or extintor='$fecha' or tacografo='$fecha' or seguro='$fecha' LIMIT 10";
$consulta = mysql_query($sql) or die ("No se pudo ejecutar la consulta");
while ($registro=mysql_fetch_assoc($consulta) ) {
$mail = $registro['modelo']."<br>".$registro['matricula']."<br>";
if ($registro['revision']==$fecha) {
$mail .= "PASAR REVISIÓN EN ".$registro['revision']."<br>";
}
if ($registro['extintor']==$fecha) {
$mail .= "PASAR REVISION EXTINTOR EN :".$registro['extintor']."<br>";
}
if ($registro['tacografo']==$fecha) {
$mail .= "PASAR REVISIÓN TACÓGRAFO EN :".$registro['tacografo']."<br>";
}
if ($registro['seguro']==$fecha) {
$mail .= "RENOVAR SEGURO EN:".$registro['seguro']."<br>";
}
}
ini_set("SMTP","localhost"); //si no se tiene un smtp en localhost reemplazar por el q corresponda
$from = "[email protected]";
$to = "[email protected]";
$asunto = "Mail de la web";
$header = "MIME-Version: 1.0 Content-Type: multipart/alternative;\nContent-Type: text/html;Charset = 'iso-8859-1'Content -Transfer - Encoding: quoted -printable";
if (mail($to,$asunto,$mail,$header)) {
echo "El mail ha sido enviado con exito";
}else {
echo "No se ha podido enviar el mail";
}