Compare commits
3 Commits
master
...
with-phpma
Author | SHA1 | Date |
---|---|---|
|
dc64008c44 | 8 months ago |
|
3f995330ee | 1 year ago |
|
91178ad3d7 | 1 year ago |
@ -0,0 +1,14 @@ |
||||
<IfModule mod_rewrite.c> |
||||
# Редирект: ...// -> .../ |
||||
RewriteCond %{REQUEST_URI} (.*)\/\/$ |
||||
RewriteRule ^(.*)$ https://%{HTTP_HOST}/%1/ [R=301,L] |
||||
|
||||
# Редирект: с www -> без www |
||||
RewriteCond %{HTTP_HOST} ^www\.(.*)$ |
||||
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] |
||||
|
||||
# Редирект: HTTP -> HTTPS |
||||
RewriteCond %{HTTP:X-Forwarded-Proto} !https |
||||
RewriteCond %{HTTPS} off |
||||
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] |
||||
</IfModule> |
@ -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"; |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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!"; |
||||
} |
Loading…
Reference in new issue