mail adresleri yerine açıklamalarını yazdım

buyrun


require 'PHPMailerAutoload.php';



$name = $_POST["name"];
$phone = $_POST["phone"];
$ticket = $_POST['ticket'];
$quantity = $_POST["quantity"];
$mail = $_POST['mail'];

$messageBody = 'İsim ve Soyad : ' . $name . ' ' . "\n";
$messageBody .= 'Email : ' . $mail . ' ' . "\n";
$messageBody .= 'Telefon : ' . $phone . ' ' . "\n";
$messageBody .= 'İstiyor : ' . $ticket . ' ' . "\n";
$messageBody .= 'Yarışması : ' . $quantity . ' ' . "\n";
$messageBody .= ' ' . "\n";


$mail = new PHPMailer;

//$mail->SMTPDebug = 4;
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.office365.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'email'; // SMTP username
$mail->Password = 'şifre'; // SMTP password
//$mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
$mail->CharSet = 'UTF-8';

$mail->From = 'gönderen mail adresi';
$mail->FromName = 'YARIŞMA';
$mail->addAddress('mail', 'Fikir Havuzu');
$mail->addReplyTo($mail, $name);

$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
$mail->isHTML(true);

$mail->Subject = 'TASARIM YARIŞMASI - '. $name;
$mail->Body = $messageBody;

//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}


$owner_email = "**mailadresi**";
$headers = $_POST["mail"] . ' dan';
$subject = 'TASARIM YARIŞMASI : ' . $_POST["name"] . ' DAN';
$messageBody = "";
if($_POST['name']!='nope'){
$messageBody .= 'İsim ve Soyad : ' . $_POST["name"] . ' ' . "\n";
$messageBody .= 'Telefon : ' . $_POST["phone"] . ' ' . "\n";
$messageBody .= 'İstiyor : ' . $_POST["ticket"] . ' ' . "\n";
$messageBody .= 'Yarışması : ' . $_POST["quantity"] . ' ' . "\n";
$messageBody .= ' ' . "\n";}
if($_POST['mail']!='nope'){
$messageBody .= 'Email : ' . $_POST['mail'] . ' ' . "\n";
$messageBody .= '' . "\n";
}else{$headers = '';}
if($_POST['message']!='nope'){$messageBody .= ' ' . $_POST['message'] . ' ' . "\n";}
if($_POST["stripHTML"] == 'true'){$messageBody = strip_tags($messageBody);}
try{
if(!mail($owner_email, $subject, $messageBody, $headers)){throw new Exception('');}else{echo 'Thanks ';}
}
catch(Exception $e){echo $e->getMessage() ."\n";}

?>