Me encontré con esto, estoy trabajando con mimes para enviar correo php, y todo esta muy excepto que cuando uso una variable para from, me sale que mi servidor envia el correo a nombre de la variable y este correo se envia a la carpeta de correo no deseado
Código HTML:
$to = $correo;
[HTML]
$to = '[email protected]' . ', '; // note the comma
$to .= $_POST['email'];
[HTML]
YO quisiera usar solo la variable que viene del formulario,
Este es el codigo completo,
Código HTML:
<?php // multiple recipients $subject = $_POST['asunto']; $mensaje = $_POST['mensaje']; $from = $_POST['from']; $correo = $_POST["email"]; $mensaje=str_replace("\n","<p>",$mensaje); //$to = '[email protected]' . ', '; // note the comma //$to .= $_POST['email']; $to = $correo; // subject //$subject = 'Informacion'; // message $message = ' <html> <head> <title>Informacion</title> <style> body { font-family: Arial, Helvetica, sans-serif; } p { text-indent:15px; } table { background:#e1eae1; width:791px; } </style> </head> <body><center> <table border=1 bordercolor="#000000" > <tr> <td><img src="http://www.entre-vecinos.com/imagenes/bannercorreos.jpg"> ' . "\r\n"; $message .= '<p>'. $mensaje; ; $message .=' </table> </td></tr></table> </center> </body> </html> '; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: Entre Vecinos<' .$from .">\r\n"; $headers .= 'Cc: ' . "\r\n"; $headers .= 'Bcc: [email protected]. "\r\n"; // Mail it mail($to, $subject, $message, $headers); ?>
Buen dia