Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $to = $_POST['to'];
- $correosver = array("mbravo15@gmail.com", "kurtcobain555@hotmail.com", "cotizaciones@$$$.com.mx");
- $randIndex = array_rand($correosver, 1);
- $subject = $_POST['subject'];
- $headers = 'MIME-Version: 1.0' . "rn";
- $headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";
- $headers .= "From: ".$_POST['nombre']."<".$_POST['email'].">rn";
- $headers .= "Reply-To: ".$_POST["email"]."rn";
- $ciudad = $_POST['ciudad'];
- $message = "<table>
- <tr><td>Quiero: </td><td>".$_POST['quiero']."</td></tr>
- <tr><td>Nombre: </td><td>".$_POST['nombre']."</td></tr>
- <tr><td>Ciudad: </td><td>".$_POST['ciudad']."</td></tr>
- <tr><td>Email: </td><td>".$_POST['email']."</td></tr>
- <tr><td>Teléfono: </td><td>".$_POST['tel']."</td></tr>
- <tr><td>Companía: </td><td>".$_POST['compania']."</td></tr>
- <tr><td>Contrato: </td><td>".$_POST['plan']."</td></tr>
- <tr><td>Equipo: </td><td>".$_POST['equipo']."</td></tr>
- <tr><td>Dudas: </td><td>".$_POST['dudas']."</td></tr>
- </table>" ;
- if($ciudad == 'veracruz') {
- $to = $randIndex;
- }
- else if($ciudad == 'alvarado') {
- $to = 'cotizaciones@###.com.mx';
- }
- else if($ciudad == 'tuxtepec') {
- $to = 'supervisorcuenca@###.com.mx, cotizaciones@###.com.mx';
- }
- else if($ciudad == 'poza_rica') {
- $to = 'supervisorpozarica@###.com.mx, cotizaciones@###.com.mx';
- }
- else if($ciudad == 'xalapa') {
- $to = 'supervisorxalapa@###.com.mx, cotizaciones@###.com.mx';
- }
- else if($ciudad == 'san_andres') {
- $to = 'supervisorcuenca@###.com.mx, cotizaciones@###.com.mx';
- }
- if(mail($to, $subject, $message, $headers)){
- header("Location: /index.html");
- exit; // we are sending this text to the ajax request telling it that the mail is sent..
- }else{
- echo 'failed';// ... or this one to tell it that it wasn't sent
- }
- ?>
- $correosver = array("mbravo15@gmail.com", "kurtcobain555@hotmail.com", "cotizaciones@$$$.com.mx");
- $randIndex = array_rand($correosver, 1);
- if($ciudad == 'veracruz') {
- $to = $randIndex;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement