<?php
//Import PHPMailer classes into the global namespace
//These must be at the top of your script, not inside a function
require '../assets/vendor/phpmailer/src/Exception.php';
require '../assets/vendor/phpmailer/src/PHPMailer.php';
require '../assets/vendor/phpmailer/src/SMTP.php';
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 0; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for Gmail
$mail->Host = 'smtp.gmail.com';
$mail->Port = 465;
$mail->Username = 'mailadresim@mail.com';
$mail->Password = 'sifrem';
$mail->SetFrom('mailadresim@mail.com', 'sender');
$mail->Subject = 'deneme konu';
$mail->Body = 'deneme body';
$mail->AddAddress('mailadresim@mail.com');
if(!$mail->Send()) {
$error = 'Mail error: '.$mail->ErrorInfo;
return false;
} else {
$error = 'Message sent!';
return true;
}
?>Html'deki form buraya post method ile gidiyor. acaba sizce sorun ne oalbilir?