Contact
$check=1;
if(isset($_POST["gonder"]))
{
$isim = htmlspecialchars($_POST["isim"]);
$telefon = htmlspecialchars($_POST["telefon"]);
$eposta = htmlspecialchars($_POST["eposta"]);
$mesaj = htmlspecialchars($_POST["mesaj"]);
if (empty($isim) || empty($eposta) || empty($telefon) || empty($mesaj))
{
?>
Error
There are blank fields on the form<
Please fill in the fields and try again.
|
$check=0;
}
elseif (eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$",$eposta) && $check==1)
{
require("SABITLER/mail/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->IsHTML(TRUE);
$mail->Host = "mail.gayrettekstil.com"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "
[email protected]"; // SMTP username
$mail->Password = "mail987"; // SMTP password
$mail->From = htmlspecialchars($_POST['eposta']);
$mail->Fromname = htmlspecialchars($_POST['isim']);
$mail->AddAddress("
[email protected]","İletişim Formu");
$mail->Subject = "İLETİŞİM FORMUNDAN";
$mail->Sender = $eposta;
$mail->Body = '
'.
"
Ad Soyad | : " .$isim. " |
Telefon | : " .$telefon. " |
E-Posta | : " .$eposta. " |
Mesaj | : " .$mesaj. " |
IP | : " .$_SERVER['REMOTE_ADDR']. " |
";
if(!$mail->Send())
{
?>
Your message did not reach us. Please try again after a short period of time.
Thank you for your attention.
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
?>
Your message was sent to the concerned unit.
Thank you for your attention.
}
else {
?>
E-mail address has a typo.
Please check your e-mail address and try again.
|
$check=0;
}
}
if(!isset($_POST["gonder"]) || $check==0) {
?>
}
?>