diff --git a/app/index.php b/app/index.php index 4dab982..e43567c 100644 --- a/app/index.php +++ b/app/index.php @@ -15,6 +15,7 @@ require 'routes/anpay.php'; require 'routes/sendmail.php'; require 'routes/report.php'; require 'routes/generation.php'; +require 'routes/push.php'; #lib require 'libs/logsave.php'; #api diff --git a/app/routes/anpay.php b/app/routes/anpay.php index 7cd6884..7600c5f 100644 --- a/app/routes/anpay.php +++ b/app/routes/anpay.php @@ -240,7 +240,7 @@ function sendstatus_kuri(){ $message = "Ваш заказ выполнен.

Он будет всегда доступен в Вашем личном кабинете.

- Чтобы войти в КЛАН перейдите по ссылке - https://klan.argumenti.ru/login. Введите свой логин и пароль. Если Вы еще не пользовались кабинетом создайте пароль, использую эту электронную почту. Если пароль забыли, воспользуйтесь опцией Забыли пароль, используя эту электронную почту."; + Чтобы войти в КЛАН перейдите по ссылке - https://klan.argumenti.ru/login. Введите свой логин и пароль. Если Вы еще не пользовались кабинетом создайте пароль, используя эту электронную почту. Если пароль забыли, воспользуйтесь опцией Забыли пароль, используя эту электронную почту."; $subject = "Аргументы Недели: заказ выполнен"; $result = klanmail($order['buy_email'], $subject, $message, set('klanmail')); } diff --git a/app/routes/email.php b/app/routes/email.php index dfe6e73..2133323 100644 --- a/app/routes/email.php +++ b/app/routes/email.php @@ -3,7 +3,49 @@ use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; -function sendmail($config, $mail){ + +function sendmail($config, $mail) { + ini_set('display_errors', 1); + ini_set('display_startup_errors', 1); + error_reporting(E_ALL); + + $send = new PHPMailer(true); + + try { + //$send->SMTPDebug = 2; // Включить отладку + //$send->Debugoutput = 'html'; + + $send->isSMTP(); + $send->Host = 'mail.argumenti.ru'; + $send->SMTPAuth = true; + $send->CharSet = 'UTF-8'; + $send->Username = 'klan@mail.argumenti.ru'; + $send->Password = 'Adfhj789-jkhgk6F'; + $send->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; + $send->Port = 587; + + $send->setFrom('klan@mail.argumenti.ru', 'Аргументы Недели'); + $send->addAddress($mail['mail'], $mail['mail']); + + if (isset($mail['html'])) { + $send->isHTML(true); + } else { + $send->ContentType = 'text/plain'; + $send->isHTML(false); + } + + $send->Subject = $mail['subject']; + $send->Body = $mail['message']; + + return $send->send(); + } catch (Exception $e) { + //echo "Ошибка отправки: {$e->getMessage()}"; + echo '

К сожалению в данный момент письмо невозможно отправить.

Попробуйте позже.

'; + } +} + + +function sendmail_old($config, $mail){ $send = new PHPMailer; $send->isSMTP(); @@ -39,4 +81,6 @@ function sendmail($config, $mail){ return $send->send(); -} \ No newline at end of file +} + +