გამარჯობა ყველას,
მეილი ვერ გავაკეთე, smtp -ზე send.php აგზავნის მეილს phpmailer-ით;
html - ის ფორმასთან დაკავშირებით ერორს მიგდებს "Message could not be sent. Mailer Error: Invalid address: (to):"
კოდი ესაა:
html--->
<form method="post" action="send.php">
<div class="login">
<input type="text" name="name" placeholder="სახელი" class="input">
<input name="email" type="email" placeholder="e-mail მისამართი" class="input">
</div>
<!-- <div class="subject">
<input name="satauri" type="text" placeholder="სათაური" class="input">
</div> -->
<div class="msg">
<textarea name="message" class="area" placeholder="ტექსტი..."></textarea>
</div>
<div class="btni"><button class="btni1">გაგზავნა</button> </div>
</div>
</form
php ---->
<?php
$name = $_POST['name'];
$maili = $_POST['email'];
$message = $_POST['message'];
// Import PHPMailer classes into the global namespace
// These must be at the top of your scr1pt, not inside a functi0n
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
//Load Composer's autoloader
require 'vendor/autoload.php';
$mail = new PHPMailer(true); // Passing `true` enables exceptions
try {
//Server settings
$mail->SMTPDebug = 0; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '******@gmail.com'; // SMTP username
$mail->Password = '******'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
//Recipients
$mail->setFrom('******@gmail.com','gmail');
$mail->addAddress($maili,$name); // Add a recipient
// Name is optional
$body="Hello ".$name."meili:".$message.'reply '.$maili;
//Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Inquiry'.$name;
$mail->Body = $body;
$mail->AltBody = strip_tags($body);
$mail->send();
echo 'Message has been sent';
} catch (Exception $e) {
echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
}
solution ვერ ვიპოვე ვერსად ინტერნეტში

გუგლის smtp მუშაობს, ცალკე გაიგზავნა მეილი, სანამ html-თან დავაკავშირებდი : ((