Compare commits
3 Commits
b208ae3e64
...
with-phpma
| Author | SHA1 | Date | |
|---|---|---|---|
| dc64008c44 | |||
| 3f995330ee | |||
|
|
91178ad3d7 |
40
PHPMailer/Exception.php
Normal file
40
PHPMailer/Exception.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHPMailer Exception class.
|
||||
* PHP Version 5.5.
|
||||
*
|
||||
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
||||
*
|
||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||
* @author Brent R. Matzelle (original founder)
|
||||
* @copyright 2012 - 2020 Marcus Bointon
|
||||
* @copyright 2010 - 2012 Jim Jagielski
|
||||
* @copyright 2004 - 2009 Andy Prevost
|
||||
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
namespace PHPMailer\PHPMailer;
|
||||
|
||||
/**
|
||||
* PHPMailer exception handler.
|
||||
*
|
||||
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
|
||||
*/
|
||||
class Exception extends \Exception
|
||||
{
|
||||
/**
|
||||
* Prettify error message output.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function errorMessage()
|
||||
{
|
||||
return '<strong>' . htmlspecialchars($this->getMessage(), ENT_COMPAT | ENT_HTML401) . "</strong><br />\n";
|
||||
}
|
||||
}
|
||||
5248
PHPMailer/PHPMailer.php
Normal file
5248
PHPMailer/PHPMailer.php
Normal file
File diff suppressed because it is too large
Load Diff
1499
PHPMailer/SMTP.php
Normal file
1499
PHPMailer/SMTP.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,11 @@
|
||||
## **Порядок работы**
|
||||
|
||||
### **Подготовка окружения для локальной разработки**
|
||||
1. Выкачивать локально на свой компьютер шаблон командой: `git clone https://git.good-production.xyz/Good-Production/template-for-verstka.git`
|
||||
1. Выкачивать локально на свой компьютер один из 2х шаблонов (по веткам: 1 - master, 2 - with-phpmailer) командой: `git clone -b ${branch_name} https://git.good-production.xyz/Good-Production/template-for-verstka.git`
|
||||
|
||||
заменить переменную:
|
||||
`${branch_name}` -- на "master", если достаточно только отправки форм в ТГ, либо "with-phpmailer", если нужна отправка на почту средствами PHP (без использования плагинов CMS)
|
||||
|
||||
2. Далее создать свою ветку командой: `git checkout -b ${project_name}--${name}`
|
||||
3. Приступить к локальной разработке в созданной ветке
|
||||
4. Для демонстрации работы пушить свои комиты в созданную ветку командой: `git push origin ${project_name}--${name}`
|
||||
|
||||
@@ -1,89 +1,16 @@
|
||||
/* Переменные, шрифты, UI kit */
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
700 - Bold
|
||||
600 - SemiBold / Demi
|
||||
500 - Medium
|
||||
400 - Regular
|
||||
*/
|
||||
|
||||
/* Craftwork Grotesk */
|
||||
@font-face {
|
||||
font-family: "Craftwork Grotesk";
|
||||
src: local("Craftwork Grotesk Bold"),
|
||||
url("/assets/fonts/craftwork/CraftworkGrotesk-SemiBold.woff2") format("woff2"),
|
||||
url("/assets/fonts/craftwork/CraftworkGrotesk-Bold.woff") format("woff"),
|
||||
url("/assets/fonts/craftwork/craftwork-grotesk-bold.ttf") format("ttf");
|
||||
font-weight: 700;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "Craftwork Grotesk";
|
||||
src: local("Craftwork Grotesk SemiBold"),
|
||||
url("/assets/fonts/craftwork/CraftworkGrotesk-SemiBold.woff2") format("woff2"),
|
||||
url("/assets/fonts/craftwork/CraftworkGrotesk-SemiBold.woff") format("woff"),
|
||||
url("/assets/fonts/craftwork/craftwork-grotesk-semi-bold.ttf") format("ttf");
|
||||
font-weight: 600;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "Craftwork Grotesk";
|
||||
src: local("Craftwork Grotesk Medium"),
|
||||
url("/assets/fonts/craftwork/CraftworkGrotesk-Medium.woff2") format("woff2"),
|
||||
url("/assets/fonts/craftwork/CraftworkGrotesk-Medium.woff") format("woff"),
|
||||
url("/assets/fonts/craftwork/craftwork-grotesk-medium.ttf") format("ttf");
|
||||
font-weight: 500;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "Craftwork Grotesk";
|
||||
src: local("Craftwork Grotesk Regular"),
|
||||
url("/assets/fonts/craftwork/CraftworkGrotesk-Regular.woff2") format("woff2"),
|
||||
url("/assets/fonts/craftwork/CraftworkGrotesk-Regular.woff") format("woff"),
|
||||
url("/assets/fonts/craftwork/craftwork-grotesk-regular.ttf") format("ttf");
|
||||
font-weight: 400;
|
||||
}
|
||||
/* Craftwork Grotesk */
|
||||
|
||||
/* din 2014 */
|
||||
@font-face {
|
||||
font-family: "DIN 2014 Rounded";
|
||||
src: local("DIN 2014 Rounded Demi"),
|
||||
url("/assets/fonts/din-2014/din-2014-rounded-demi.woff2") format("woff2"),
|
||||
url("/assets/fonts/din-2014/din-2014-rounded-demi.woff") format("woff"),
|
||||
url("/assets/fonts/din-2014/din-2014-rounded-demi.ttf") format("ttf");
|
||||
font-weight: 600;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "DIN 2014 Rounded";
|
||||
src: local("DIN 2014 Rounded Regular"),
|
||||
url("/assets/fonts/din-2014/din-2014-rounded-regular.woff2") format("woff2"),
|
||||
url("/assets/fonts/din-2014/din-2014-rounded-regular.woff") format("woff"),
|
||||
url("/assets/fonts/din-2014/din-2014-rounded-regular.ttf") format("ttf");
|
||||
font-weight: 400;
|
||||
}
|
||||
/* din 2014 */
|
||||
|
||||
/* roboto */
|
||||
@font-face {
|
||||
font-family: "Roboto";
|
||||
src: local("Roboto Medium"),
|
||||
url("/assets/fonts/roboto/Roboto-Medium.woff2") format("woff2"),
|
||||
url("/assets/fonts/roboto/Roboto-Medium.woff") format("woff"),
|
||||
url("/assets/fonts/roboto/roboto-medium.ttf") format("ttf");
|
||||
font-weight: 500;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "Roboto";
|
||||
src: local("Roboto Regular"),
|
||||
url("/assets/fonts/roboto/Roboto-Regular.woff2") format("woff2"),
|
||||
url("/assets/fonts/roboto/Roboto-Regular.woff") format("woff"),
|
||||
url("/assets/fonts/roboto/roboto-medium.ttf") format("ttf");
|
||||
font-weight: 400;
|
||||
}
|
||||
/* roboto */
|
||||
|
||||
/* Глобальные переменные: */
|
||||
ШАБЛОН использования глобальных переменных:
|
||||
|
||||
:root {
|
||||
--main-text: #e1667c;
|
||||
--main-color: #8da6cb;
|
||||
--font-family: "Craftwork Grotesk", sans-serif;
|
||||
--second-family: "DIN 2014 Rounded", sans-serif;
|
||||
--third-family: "Roboto", sans-serif
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
15
index.html
15
index.html
@@ -48,7 +48,20 @@
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>test</p>
|
||||
|
||||
|
||||
<!-- Пример формы для отправки в Телеграмм (обработчик send-telegram.php) -->
|
||||
<form class="form" method="post" action="/send-telegram.php">
|
||||
<div class="form__item">
|
||||
<input class="form__input" type="text" name="name" required>
|
||||
<label class="form__label">Ваше имя</label>
|
||||
</div>
|
||||
<div class="form__item">
|
||||
<input class="form__input" type="text" name="phone" required>
|
||||
<label class="form__label">Номер телефона</label>
|
||||
</div>
|
||||
<input class="form__input btn" type="submit" value="Отправить">
|
||||
</form>
|
||||
|
||||
|
||||
<script src="/assets/js/gp-main.js"></script>
|
||||
|
||||
29
send-SMTP.php
Normal file
29
send-SMTP.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
use PHPMailer\PHPMailer;
|
||||
use PHPMailer\Exception;
|
||||
|
||||
require 'PHPMailer/Exception.php';
|
||||
require 'PHPMailer/PHPMailer.php';
|
||||
require 'PHPMailer/SMTP.php';
|
||||
|
||||
$mail = new PHPMailer;
|
||||
$mail->isSMTP();
|
||||
$mail->SMTPDebug = 2; // 0 = off (for production use) - 1 = client messages - 2 = client and server messages
|
||||
$mail->Host = "smtp.gmail.com"; // use $mail->Host = gethostbyname('smtp.gmail.com'); // if your network does not support SMTP over IPv6
|
||||
$mail->Port = 587; // TLS only
|
||||
$mail->SMTPSecure = 'tls'; // ssl is depracated
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->Username = $smtpUsername;
|
||||
$mail->Password = $smtpPassword;
|
||||
$mail->setFrom($emailFrom, $emailFromName);
|
||||
$mail->addAddress($emailTo, $emailToName);
|
||||
$mail->Subject = 'PHPMailer GMail SMTP test';
|
||||
$mail->msgHTML("test body"); //$mail->msgHTML(file_get_contents('contents.html'), __DIR__); //Read an HTML message body from an external file, convert referenced images to embedded,
|
||||
$mail->AltBody = 'HTML messaging not supported';
|
||||
// $mail->addAttachment('images/phpmailer_mini.png'); //Attach an image file
|
||||
|
||||
if(!$mail->send()){
|
||||
echo "Mailer Error: " . $mail->ErrorInfo;
|
||||
}else{
|
||||
echo "Message sent!";
|
||||
}
|
||||
Reference in New Issue
Block a user