Advertisement
Guest User

Untitled

a guest
Aug 6th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.68 KB | None | 0 0
  1. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" />
  2. <?php
  3.  
  4. header ("Content-Type: text/html; charset=iso-8859-9");
  5. function reday($url){
  6.     if (!headers_sent()){
  7.         header('Location: '.$url); exit;
  8.     }else{
  9.         echo '<script type="text/javascript">';
  10.         echo 'window.location.href="'.$url.'";';
  11.         echo '</script>';
  12.         echo '<noscript>';
  13.         echo '<meta http-equiv="refresh" content="0;url='.$url.'" />';
  14.         echo '</noscript>'; exit;
  15.     }
  16. }
  17. $ns = $_POST["ns"];
  18. $e = $_POST["e"];
  19. $t = $_POST["t"];
  20. $s = $_POST["s"];
  21. $m = $_POST["m"];
  22.  
  23. $mesaj = "";
  24. $mesaj .= "Name & Surname : " . $ns . " \n";
  25. $mesaj .= "E-Mail : " . $e . " \n";
  26. $mesaj .= "Telephone : " . $t . " \n";
  27. $mesaj .= "Subject : " . $s . " \n";
  28. $mesaj .= "Message : " . $m . " \n";
  29.  
  30. function replace_tr($text)
  31. {
  32. $text = trim($text);
  33. $search = array('Ç','ç','Ğ','ğ','ı','İ','Ö','ö','Ş','ş','Ü','ü');
  34. $replace = array('C','c','G','g','i','I','O','o','S','s','U','u');
  35. $new_text = str_replace($search,$replace,$text);
  36. return $new_text;
  37. }
  38.  
  39.  
  40. $eposta_konusu = 'Contact Form';
  41. $eposta_mesaji = replace_tr($mesaj);
  42.  
  43.     require_once("class.phpmailer.php");
  44.  
  45.     $mail = new PHPMailer();
  46.     $mail->IsSMTP();
  47.     $mail->Host = "mail.site.com";
  48.     $mail->SMTPAuth = true;
  49.     $mail->Username = "bilgi@site.com";
  50.     $mail->Password = "sifre";
  51.     $mail->From = "bilgi@site.com";
  52.     $mail->Fromname = "Site Form";
  53.     $mail->AddAddress("bilgi@site.com","Mail");
  54.     $mail->Subject = $eposta_konusu;
  55.     $mail->Body = $eposta_mesaji;
  56.  
  57.     if(!$mail->Send())
  58.     {
  59.        echo '<font color="#F62217"><b>Gönderim Hatası: ' . $mail->ErrorInfo . '</b></font>';
  60.        exit;
  61.     }
  62. elseif ($mail->Send())
  63. {
  64. reday("iletisim.php?i=1");
  65. }
  66. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement