Código PHP:
<?php
$to = $_POST["email"];
if ($_POST){
$num = md5(time());
$to = $_POST["email"];
//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 .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["recomendacion_modelo_1"] . "</span> </br>";
$body .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["recomendacion_modelo_2"] . "</span> </br>";
$body .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["recomendacion_modelo_3"] . "</span> </br>";
$body .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["recomendacion_modelo_4"] . "</span> </br>";
$body .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["recomendacion_modelo_5"] . "</span> </br>";
$body .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["recomendacion_modelo_6"] . "</span> </br>";
$body .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["recomendacion_modelo_7"] . "</span> </br>";
$body .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["recomendacion_modelo_8"] . "</span> </br>";
$body .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["recomendacion_modelo_9"] . "</span> </br>";
$body .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["recomendacion_modelo_10"] . "</span> </br>";
$body .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["recomendacion_modelo_11"] . "</span> </br>";
$body .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["recomendacion_modelo_12"] . "</span> </br>";
$body .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["recomendacion_modelo_13"] . "</span> </br>";
$body .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["recomendacion_modelo_14"] . "</span> </br>";
$body .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["recomendacion_modelo_15"] . "</span> </br>";
$body .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["recomendacion_modelo_16"] . "</span> </br>";
$body .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["recomendacion_modelo_17"] . "</span> </br>";
$body .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["recomendacion_modelo_18"] . "</span> </br>";
$body .= "
<strong style='color:#0090C6;'></strong>
<br><span style='color:#767676;'>" . $_POST["Comentario"] . "</span> </br>";
$body .= "</body></html>";
if(isset($_FILES["filead"]["name"]) ) //FILES EXISTS
{
$_name=$_FILES["filead"]["name"];
$_type=$_FILES["filead"]["type"];
$_size=$_FILES["filead"]["size"];
$_temp=$_FILES["filead"]["tmp_name"];
$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 <*****@hotmail.com>\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/mixed; ";
$headers .= "boundary=".$num."\r\n";
$headers .= "--".$num."\n";
'Reply-To: ****@outlook.com'."\r\n" .
'X-Mailer: PHP/' . phpversion();
// 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."--";
'Reply-To: a*****@outlook.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
}else { //FILES NO EXISTS
// HTML HEADERS
$headers = "From: **** \r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"". $boundary. "\"\r\n";
}
// SEND MAIL
mail($to, "Monitoreo grupo bedoya" , $body, $headers);
echo "<div class='ok'>
<strong>El formulario se ha enviado correctamente.</strong></div>";
}
?>