Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $mensaje = "";
- $mensaje.="De: " . $_POST['nombre'] . "\n";
- $mensaje.="E-mail: " . $_POST['correo'] . "\n";
- $mensaje.="Telefono: " . $_POST['telefono'] . "\n";
- $mensaje.="Descripción: " . $_POST['descripcion'] . "\n";
- //
- //
- $pagina = substr($_SERVER["HTTP_REFERER"], (strrpos($_SERVER["HTTP_REFERER"], '/') + 1));
- $pagina = preg_split("/\./", $pagina);
- $nombre = $_POST['nombre'];
- $email = $_POST['correo'];
- // definimos a quien se lo enviamos
- $email_destiny = "juanfranp@gmail.com";
- if(empty($pagina[0])){
- $subject = "Cotización Blog";
- }else{
- $subject = "Cotización ".$pagina[0];
- }
- //if (mail($email_destiny,$subject,$mensaje,"From: Contact<".$_POST['correo'].">")) {
- // echo '<p align="center"><b>Thanks for your comments</b></p>';
- //} else {
- // echo '<p align="center">Error '.$_POST['nombre'].'</p>';
- //}
- $headers = "From: ".$nombre."<".$email.">\r\n";
- $headers .= "X-Mailer: PHP5 \r\n";
- $headers .= 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
- $headers2 = "From: Bezier<noreply@bezier.xyz>\r\n";
- $headers2 .= "X-Mailer: PHP5\r\n";
- $headers2 .= 'MIME-Version: 1.0' . "\r\n";
- $headers2 .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
- if (mail($email_destiny, $subject, $mensaje, $headers)) {
- $men = 'Hemos recibido con exito su solicitud, a la mayor brevedad posible nos podemos en contacto';
- if(mail($_POST['correo'], 'Confirmación Recibido', $men, $headers2)){
- echo 'test';
- }
- } //ENVIAR!
- //die('trululu');
- // Guardar los datos recibidos en variables:
- //$nombre = $_POST['nombre'];
- //$email = $_POST['email'];
- //$mensaje = $_POST['mensaje'];
- //// Definir el correo de destino:
- //$dest = "crhystyann@gmail.com";
- //
- //// Estas son cabeceras que se usan para evitar que el correo llegue a SPAM:
- //$headers = "From: $nombre $email\r\n";
- //$headers .= "X-Mailer: PHP5\n";
- //$headers .= 'MIME-Version: 1.0' . "\n";
- //$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
- //
- //// Aqui definimos el asunto y armamos el cuerpo del mensaje
- //$asunto = "Contacto";
- //$cuerpo = "<strong>Nombre:</strong> ".$nombre."<br>";
- //$cuerpo .= "<strong>Email:</strong> ".$email."<br>";
- //$cuerpo .= "<strong>Mensaje:</strong> ".$mensaje;
- // //die('trululu');
- //// Esta es una pequena validación, que solo envie el correo si todas las variables tiene algo de contenido:
- //if($nombre != '' && $email != '' && $mensaje != ''){
- // // mail($dest,$asunto,$cuerpo,$headers); //ENVIAR!
- //
- // mail($dest, $asunto, $cuerpo);
- //
- //
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement