
16/03/2008, 10:48
|
 | | | Fecha de Ingreso: febrero-2008
Mensajes: 2.183
Antigüedad: 17 años Puntos: 52 | |
Re: Un problemita con funcion mail() pruebas esto EmaD: Código PHP: $row = mysql_fetch_array($result); //esto lo tengo despoes del query para meter $result de la BD en un array en $row
// Datos del email
$nombre_origen = "Cevit";
$email_origen = "mi mail de [email protected]";
$email_copia = "mi mail de [email protected]";
$email_ocultos = "mi mail de [email protected]";
//$email_destino = "".$row['email'].""; //recojo la variable del array en $row
$email_destino = "mi mail de [email protected]"; //cambiar esta linea por la de encima cuando termine la aplicacion
$asunto = "".$row['usuario']." Asunto que sea.";
$mensaje = '<table width="629" border="0" cellspacing="1" cellpadding="2">
<tr>
<td width="623" align="left"></td>
</tr>
<tr>
<td bgcolor="#2EA354"><div style="color:#FFFFFF; font-size:14; font-family: Arial, Helvetica, sans-serif; text-transform: capitalize; font-weight: bold;"><strong> '.$row['usuario'].' su clave a sido recuperada</strong></div></td>
</tr>
<tr>
<td height="95" align="left" valign="top"><div style=" color:#000000; font-family:Arial, Helvetica, sans-serif; font-size:12px; margin-bottom:3px;"> '.$row['usuario'].'</strong>, usted ordeno recuperar su clave..<br>
<strong>Su Clave es : </strong>'.$row['password'].'<br>
</div>
</td>
</tr>
</table>';
$formato = "html";
//*****************************************************************//
$headers = "From: $nombre_origen <$email_origen> \r\n";
$headers .= "Return-Path: <$email_origen> \r\n";
$headers .= "Reply-To: $email_origen \r\n";
$headers .= "X-Sender: $email_origen \r\n";
$headers .= "X-Priority: 3 \r\n";
$headers .= "MIME-Version: 1.0 \r\n";
$headers .= "Content-Transfer-Encoding: 7bit \r\n";
//*****************************************************************//
if($formato == "html")
{ $headers .= "Content-Type: text/html; charset=iso-8859-1 \r\n"; }
else
{ $headers .= "Content-Type: text/plain; charset=iso-8859-1 \r\n"; }
if (@mail($email_destino, $asunto, $mensaje, $headers))
{ echo "Le hemos enviado un correo electronico con sus datos de registro. "; }
else
{ echo "Error, No se ha establecido la conexión con el servidor, por favor intentelo de nuevo pasados unos minutos. "; }
}
}
?></td>
</tr>
</table>
<table width="2" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td height="298"> </td>
</tr>
</table>
<table width="173" height="189" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="189" align="left" valign="top">
</table></td>
</tr>
</table>
Pruebalo, este codigo lo saque de aqui, de FOROS DEL WEB y me va bien
Un saludo |