Answer the question
In order to leave comments, you need to log in
Language issue in form submission?
What did not add / what is not correct?
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
require_once "PHPMailer/PHPMailer.php";
require_once "PHPMailer/Exception.php";
require_once "PHPMailer/SMTP.php";
$name = $_POST['name'];
$email = $_POST['mail'];
$phone = $_POST['phone'];
$mail = new PHPMailer();
//Server settings
$mail->isSMTP(); // Send using SMTP
$mail->SetLanguage("en", 'send-message/lang/');
$mail->SetLanguage("ru", 'send-message/lang/');
$mail->Host = 'smtp.mail.ru'; // Set the SMTP server to send through
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '[email protected]'; // SMTP username
$mail->Password = 'hsjsksk'; // SMTP password
$mail->SMTPSecure = 'ssl'; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged
$mail->Port = 465; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above
//Recipients
$mail->setFrom('[email protected]');
$mail->addAddress('[email protected]'); // Add a recipient
// Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = "Заяка с сайта!";
$mail->Body = "С лучшего, прекрасного, красивого сайта прилетела заяка. Кто же это?! <br>
$name отправил реквест <br><br>
Его контактная информация: $phone $email";
if($mail->send()) {
header('location: thank-you.html');
} else {
var_dump($mail->ErrorInfo);
}
С ð "ññµðices, ð¿¿µðºñ °ph ° turn, ðºñ ° ð² ð½ ñ ñ¹¹ °¿¿ð ðavy ð ° ° ð ° ñºð ° ° ° °. ÐÑо же ÑÑо?!
икиÑа оÑпÑавил
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question