Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/06/2014, 13:44
andresgbdesign
 
Fecha de Ingreso: junio-2014
Mensajes: 10
Antigüedad: 9 años, 10 meses
Puntos: 0
Ayudad Mailer ()

Tengo el siguiente código, lo que quiero hacer es que al escribir un email en el formulario el correo se envié a ese email y no tener que especificarlo en el código.

Código PHP:
<?php 

if ($_POST){  

$num md5(time()); 

//MAIL BODY 
$body 
<html> 
<head> 
<title>Monitoreo</title> 
</head> 
<body style='background:#EEE; padding:30px;'> 
<h2 style='color:#767676;'>Monitoreo Grupo Bedoya</h2>"


$body .= 
<strong style='color:#0090C6;'>Monitor: </strong> 
<span style='color:#767676;'>" 
$_POST["monitor"] . "</span>"

$body .= 
<strong style='color:#0090C6;'>Email: </strong> 
<span style='color:#767676;'>" 
$_POST["email"] . "</span>"

$body .= 
<strong style='color:#0090C6;'>Nick: </strong> 
<span style='color:#767676;'>" 
$_POST["nick"] . "</span>"

$body .= 
<strong style='color:#0090C6;'>Pagina Monitoreda: </strong> 
<span style='color:#767676;'>" 
$_POST["pagina"] . "</span></br>"

$body .= 
<strong style='color:#0090C6;'></strong> 
<br><b>" 
$_POST["aclaracion"] . "</b> </br>"

$body .= 
<strong style='color:#0090C6;'></strong> 
<br><span style='color:#767676;'>" 
$_POST["recomendacion_modelo"] . "</span> </br>"

$body .= "</body></html>"

$_name=$_FILES["filead"]["name"]; 
$_type=$_FILES["filead"]["type"]; 
$_size=$_FILES["filead"]["size"]; 
$_temp=$_FILES["filead"]["tmp_name"];  

if( 
strcmp($_name"") ) //FILES EXISTS 
{  
$fp fopen($_temp"rb"); 
$file fread($fp$_size); 
$file chunk_split(base64_encode($file));  

// MULTI-HEADERS Content-Type: multipart/mixed and Boundary is mandatory. 
$headers "From: Monitoreo Grupo Bedoya <[email protected]>\r\n"
$headers .= "MIME-Version: 1.0\r\n"
$headers .= "Content-Type: multipart/mixed; ";  
$headers .= "boundary=".$num."\r\n"
$headers .= "--".$num."\n";  

// HTML HEADERS  
$headers .= "Content-Type: text/html; charset=UTF-8\r\n"
$headers .= "Content-Transfer-Encoding: 8bit\r\n"
$headers .= "".$body."\n"
$headers .= "--".$num."\n";  

// FILES HEADERS  
$headers .= "Content-Type:application/octet-stream ";  
$headers .= "name=\"".$_name."\"r\n"
$headers .= "Content-Transfer-Encoding: base64\r\n"
$headers .= "Content-Disposition: attachment; "
$headers .= "filename=\"".$_name."\"\r\n\n"
$headers .= "".$file."\r\n"
$headers .= "--".$num."--";  

}else { 
//FILES NO EXISTS 

// HTML HEADERS 
$headers "From: Grupo Bedoya \r\n"
$headers .= "MIME-Version: 1.0\r\n"
$headers .= "Content-Type: text/html; charset=UTF-8\r\n"
$headers .= "Content-Transfer-Encoding: 8bit\r\n"

}  

// SEND MAIL 
mail("*****@outlook.com""Monitoreo grupo bedoya" $body$headers); 

echo 
"<div class='ok'> 
<strong>El formulario se ha enviado correctamente.</strong></div>"



?>

Última edición por Triby; 06/06/2014 a las 18:01 Razón: *** en cuenta de correo