Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. <?php
  2. $to = $_POST['to'];
  3. $correosver = array("mbravo15@gmail.com", "kurtcobain555@hotmail.com", "cotizaciones@$$$.com.mx");
  4. $randIndex = array_rand($correosver, 1);
  5. $subject = $_POST['subject'];
  6. $headers = 'MIME-Version: 1.0' . "rn";
  7. $headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";
  8. $headers .= "From: ".$_POST['nombre']."<".$_POST['email'].">rn";
  9. $headers .= "Reply-To: ".$_POST["email"]."rn";
  10. $ciudad = $_POST['ciudad'];
  11. $message = "<table>
  12. <tr><td>Quiero: </td><td>".$_POST['quiero']."</td></tr>
  13. <tr><td>Nombre: </td><td>".$_POST['nombre']."</td></tr>
  14. <tr><td>Ciudad: </td><td>".$_POST['ciudad']."</td></tr>
  15. <tr><td>Email: </td><td>".$_POST['email']."</td></tr>
  16. <tr><td>Teléfono: </td><td>".$_POST['tel']."</td></tr>
  17. <tr><td>Companía: </td><td>".$_POST['compania']."</td></tr>
  18. <tr><td>Contrato: </td><td>".$_POST['plan']."</td></tr>
  19. <tr><td>Equipo: </td><td>".$_POST['equipo']."</td></tr>
  20. <tr><td>Dudas: </td><td>".$_POST['dudas']."</td></tr>
  21. </table>" ;
  22.  
  23.  
  24.  
  25. if($ciudad == 'veracruz') {
  26.  
  27. $to = $randIndex;
  28. }
  29.  
  30. else if($ciudad == 'alvarado') {
  31. $to = 'cotizaciones@###.com.mx';
  32. }
  33.  
  34. else if($ciudad == 'tuxtepec') {
  35. $to = 'supervisorcuenca@###.com.mx, cotizaciones@###.com.mx';
  36. }
  37.  
  38. else if($ciudad == 'poza_rica') {
  39. $to = 'supervisorpozarica@###.com.mx, cotizaciones@###.com.mx';
  40. }
  41.  
  42. else if($ciudad == 'xalapa') {
  43. $to = 'supervisorxalapa@###.com.mx, cotizaciones@###.com.mx';
  44. }
  45.  
  46. else if($ciudad == 'san_andres') {
  47. $to = 'supervisorcuenca@###.com.mx, cotizaciones@###.com.mx';
  48. }
  49.  
  50. if(mail($to, $subject, $message, $headers)){
  51. header("Location: /index.html");
  52. exit; // we are sending this text to the ajax request telling it that the mail is sent..
  53. }else{
  54. echo 'failed';// ... or this one to tell it that it wasn't sent
  55. }
  56. ?>
  57.  
  58. $correosver = array("mbravo15@gmail.com", "kurtcobain555@hotmail.com", "cotizaciones@$$$.com.mx");
  59.  
  60. $randIndex = array_rand($correosver, 1);
  61.  
  62. if($ciudad == 'veracruz') {
  63. $to = $randIndex;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement