Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. <?php
  2. $email = str_replace("href="",'',$_POST['element_5_list']);
  3. $email2 = str_replace('"','',$email);
  4. $email3 =str_replace("\",'',$email2);
  5. $name = $_POST['element_0_name'];
  6. $email = str_replace(' ','',$_POST['element_1_email']);
  7. $company = $_POST['element_2_company'];
  8. $date = $_POST['element_3_date'];
  9. $comment = $_POST['element_4_comment'];
  10. $list = $_POST['element_5_list'];
  11. $mails = array();
  12. foreach($_POST['rep'] as $rep_num) {
  13. if($rep_num == 02) {$rep_num = 'a@website.com';}
  14. if($rep_num == 03) {$rep_num = 'b@website.com';}
  15. if($rep_num == 04) {$rep_num = 'c@website.com';}
  16. $mails[] = $rep_num;
  17. }
  18. $email_to = implode(',', $mails);
  19. $email_subject = "Website Wishlist Form";
  20. $email_message = "nn";
  21. function clean_string($string) {
  22. $bad = array ("content-type", "bcc:", "to:", "cc:", "href");
  23. return str_replace($bad, "",$string);
  24. }
  25. $email_message .= '<div style="font-family:Arial, Helvetica, sans-serif;padding-left: 90px;font-weight: 100;font-size: 14px;color: #2a2a2a;"><table width="800px" height="730px;"border="0" cellspacing="10" background="http://www.website.com//email_bg2.jpg">
  26. <tr>
  27. <td style="vertical-align:top;padding-left:88px;">
  28. <h2 style="padding-top:30px;padding-left:90px;"> Wishlist Order</h2><p>Someone will respond to you shortly.</p><br>';
  29. $email_message .= '<p style="max-width:750px;">Name: '. $name .'<br /></p>';
  30. $email_message .= "<p style="max-width:750px;">Email: " .clean_string($email) . "<br></p>";
  31. $email_message .= "<p style="max-width:750px;">Company: " .$company. "<br></p>";
  32. $email_message .= "<p style="max-width:750px;">Date Required: " .$date. "<br></p>";
  33. $email_message .= "<p style="max-width:750px;">Comment: " .$comment. "</span><br><br></p>";
  34. $email_message .= '<u>Items on Wishlist:</u><style>tr:nth-child(2n) </style> </u><br>'.$email3. '</table>';
  35. $email_message .= "</div>";
  36. $headers = 'From:&nbsp;'. $name. " rn".$headers .= "MIME-Version:1.0rn";
  37. $headers .= "Content-Type: text/html; charset=utf-8; rn";
  38. $add = "-f donotreply@website.com";
  39. 'X-Mailer: PHP/' .phpversion();
  40. mail($email_to, $email_subject, $email_message, $headers, $add);
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement