jQuery('video').on('volumechange', function() {
jQuery('video').attr('muted');
jQuery(this).removeAttr('muted');
})
jQuery('video').on('volumechange', function() {
jQuery('video').prop('muted', true);
jQuery(this).prop('muted', false);
})
$mail->Mailer = 'smtp';
$mail->Host = 'ssl://smtp.yandex.ru';
$mail->Host = 'smtp.yandex.ru';
$mail->SMTPSecure = 'ssl';
ini_set('error_reporting',E_ALL);
ini_set('display_errors', 1);
require 'phpmailer/PHPMailer.php';
require 'phpmailer/SMTP.php';
require 'phpmailer/Exception.php';
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
//get data from form
$name = $_POST['username'];
$phone = $_POST['userphone'];
// preparing mail content
$messagecontent ="Name = ". $name . "<br>Phone = " . $phone . "<br>";
//Create an instance; passing `true` enables exceptions
$mail = new PHPMailer(true);
try {
//Server settings
$mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output
$mail->isSMTP(); //Send using SMTP
$mail->Host = 'smtp.yandex.ru'; //Set the SMTP server to send through
$mail->SMTPAuth = true; //Enable SMTP authentication
$mail->Username = 'shop.ride@yandex.ru'; //SMTP username
$mail->Password = 'пароль внешнего приложения'; //SMTP password
//$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
//Recipients
$mail->setFrom('shop.ride@yandex.ru', 'Mailer');
$mail->addAddress('shop.ride@yandex.ru', 'Joe User'); //Add a recipient
$mail->addAddress('shop.ride@yandex.ru'); //Name is optional
$mail->addReplyTo('shop.ride@yandex.ru', 'Information');
$mail->addCC('shop.ride@yandex.ru');
$mail->addBCC('shop.ride@yandex.ru');
//Content
$mail->isHTML(true); //Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body = $messagecontent;
$mail->send();
header('Location: https://rideshop-prokat.ru/thank-you.html');
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
Fatal error: Uncaught Error: Class 'PHPMailer' not found in /var/www/artemka1-7/data/www/rideshop-prokat.ru/email.php:16 Stack trace: #0 {main} thrown in /var/www/artemka1-7/data/www/rideshop-prokat.ru/email.php on line 16
require 'phpmailer/PHPMailer.php';
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /var/www/artemka1-7/data/www/rideshop-prokat.ru/phpmailer/PHPMailerAutoload.php on line 45
Message could not be sent. Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
<?php
ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
error_reporting(E_ALL);
$to = "$_POST[letter_act]";
$from = "noreply@".$_SERVER['SERVER_NAME'];
$subject = '=?utf-8?B?'.base64_encode('С сайта "ПЗК" заявка:').'?=';
$headers .= 'Return-path: <' . $from . ">\r\n";
$headers .= 'From: заявка <' . $from . ">\r\n";
$headers .= 'Content-type: text/plain; charset=utf-8' . "\r\n";
$headers .= 'Content-Transfer-Encoding: quoted-printable' . "\r\n\r\n";
$message = "Имя: $_POST[nameUser]\n\nТелефон: $_POST[phoneUser]";
$mail = mail($to, $subject, $message, $headers);
if ($mail) {
header("Location: /thank-you/");
}
else {?>
<!DOCTYPE html>
<html>
<head>
<title>Отправка заявки</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>html {width: 100%;height: 100%;}</style>
</head>
<body style='background: #fff;'>
<div style='width:260px;height:275px;margin:100px auto;background: #fff;color:#282828;text-align:center;padding:40px 30px 0;border: 1px solid #c0c0c0;border-radius:10px;font-size: 130%;font-family: Arial,sans-serif;box-shadow:0 10px 15px rgba(0,0,0, .5);'>
<p>Произошла ошибка! Повторите попытку позже.</p>
<p><a href='index.html' style='display:block;padding:10px 25px;background:#00b5a0;border-radius:5px;color:#fff;text-decoration:none;text-shadow:1px 1px 1px #000;width:100px;margin:40px auto 0;'>На главную</a></p>
</div>
</body>
</html>
<?php }
?>