Answer the question
In order to leave comments, you need to log in
How to fix phpmailer error?
<?php
function Send_Mail($to,$subject,$body)
{
require 'config/class.phpmailer.php';
$from = "[email protected]";
$mail = new PHPMailer();
$mail->IsSMTP(true); // используем протокол SMTP
$mail->IsHTML(true);
$mail->SMTPAuth = true; // разрешить SMTP аутентификацию
$mail->Host = "tls://smtp.yourwebsite.com"; // SMTP хост
$mail->Port = 465; // устанавливаем SMTP порт
$mail->Username = "SMTP_Username"; //имя пользователя SMTP
$mail->Password = "SMTP_Password"; // SMTP пароль
$mail->SetFrom($from, 'From Name');
$mail->AddReplyTo($from,'From Name');
$mail->Subject = $subject;
$mail->MsgHTML($body);
$address = $to;
$mail->AddAddress($address, $to);
$mail->Send();
}
?>
Answer the question
In order to leave comments, you need to log in
Move to dependency management through composer rather than simple include/require
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question