<?php if (isset($_GET['islem'])) { if ($_POST['eposta']<>'' && $_POST['isim']<>'' && $_POST['konu']<>'' && $_POST['mesaj']<>'') { require_once("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPSecure = 'tls'; $mail->Host = 'smtp.yandex.com'; $mail->Port = 465; $mail->SMTPAuth = true; $mail->Username = "grafik@***.com"; $mail->Password = "***"; $mail->From = "grafik@***.com"; $mail->Fromname = $_POST['isim']; $mail->AddAddress("grafik@***.com","Mail gönderimi"); $mail->Subject = $_POST['konu'] . $_POST['eposta']; $mail->Body = $_POST['mesaj']; if(!$mail->Send()) { echo '<font color="#F62217"><b>Gönderim Hatası: ' . $mail->ErrorInfo . '</b></font>'; exit; } echo '<font color="#41A317"><b>Mesaj başarıyla gönderildi.</b></font>'; } else { echo '<font color="#F62217"><b>Tüm alanların doldurulması zorunludur.</b></font>'; } } ?>
Alıntı