Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" />
- <?php
- header ("Content-Type: text/html; charset=iso-8859-9");
- function reday($url){
- if (!headers_sent()){
- header('Location: '.$url); exit;
- }else{
- echo '<script type="text/javascript">';
- echo 'window.location.href="'.$url.'";';
- echo '</script>';
- echo '<noscript>';
- echo '<meta http-equiv="refresh" content="0;url='.$url.'" />';
- echo '</noscript>'; exit;
- }
- }
- $ns = $_POST["ns"];
- $e = $_POST["e"];
- $t = $_POST["t"];
- $s = $_POST["s"];
- $m = $_POST["m"];
- $mesaj = "";
- $mesaj .= "Name & Surname : " . $ns . " \n";
- $mesaj .= "E-Mail : " . $e . " \n";
- $mesaj .= "Telephone : " . $t . " \n";
- $mesaj .= "Subject : " . $s . " \n";
- $mesaj .= "Message : " . $m . " \n";
- function replace_tr($text)
- {
- $text = trim($text);
- $search = array('Ç','ç','Ğ','ğ','ı','İ','Ö','ö','Ş','ş','Ü','ü');
- $replace = array('C','c','G','g','i','I','O','o','S','s','U','u');
- $new_text = str_replace($search,$replace,$text);
- return $new_text;
- }
- $eposta_konusu = 'Contact Form';
- $eposta_mesaji = replace_tr($mesaj);
- require_once("class.phpmailer.php");
- $mail = new PHPMailer();
- $mail->IsSMTP();
- $mail->Host = "mail.site.com";
- $mail->SMTPAuth = true;
- $mail->Username = "bilgi@site.com";
- $mail->Password = "sifre";
- $mail->From = "bilgi@site.com";
- $mail->Fromname = "Site Form";
- $mail->AddAddress("bilgi@site.com","Mail");
- $mail->Subject = $eposta_konusu;
- $mail->Body = $eposta_mesaji;
- if(!$mail->Send())
- {
- echo '<font color="#F62217"><b>Gönderim Hatası: ' . $mail->ErrorInfo . '</b></font>';
- exit;
- }
- elseif ($mail->Send())
- {
- reday("iletisim.php?i=1");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement