PHPMailer обновлён с 5.2 до 6.8.0.

This commit is contained in:
2023-08-14 18:45:12 +03:00
parent 0d2b4aba63
commit 0f30620f61
73 changed files with 10198 additions and 4293 deletions
+36
View File
@@ -0,0 +1,36 @@
<?php
namespace Helper;
use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\PHPMailer;
class Mail
{
public static function send($to, $message, $subject = 'Бойцовский клуб'): int
{
$mail = new PHPMailer;
try {
$mail->IsSMTP();
$mail->Host = 'smtp.mail.yahoo.com';
$mail->SMTPAuth = true;
$mail->Username = 'newcombats@yahoo.com';
$mail->Password = 'uqcdbnsoagxcyysh';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;
$mail->CharSet = 'UTF-8';
$mail->setFrom('newcombats@yahoo.com', 'Бойцовский Клуб');
$mail->addAddress($to); // Add a recipient
$mail->IsHTML();
$mail->Subject = $subject;
$mail->Body = '<div>' . $message . '</div>';
$mail->AltBody = $message;
$mail->send();
return 1;
} catch (Exception $e) {
return 0;
}
}
}