Compare commits
2 Commits
with-phpma
...
test_by_ma
| Author | SHA1 | Date | |
|---|---|---|---|
| b1afb0f09c | |||
|
|
4961f2b1c9 |
@@ -1,40 +0,0 @@
|
||||
<?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";
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
1499
PHPMailer/SMTP.php
1499
PHPMailer/SMTP.php
File diff suppressed because it is too large
Load Diff
@@ -25,11 +25,7 @@
|
||||
## **Порядок работы**
|
||||
|
||||
### **Подготовка окружения для локальной разработки**
|
||||
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)
|
||||
|
||||
1. Выкачивать локально на свой компьютер шаблон командой: `git clone https://git.good-production.xyz/Good-Production/template-for-verstka.git`
|
||||
2. Далее создать свою ветку командой: `git checkout -b ${project_name}--${name}`
|
||||
3. Приступить к локальной разработке в созданной ветке
|
||||
4. Для демонстрации работы пушить свои комиты в созданную ветку командой: `git push origin ${project_name}--${name}`
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
<?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