[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://supportukrainenow.org/)
![PHPMailer](https://raw.github.com/PHPMailer/PHPMailer/master/examples/images/phpmailer.png)
# PHPMailer – A full-featured email creation and transfer class for PHP
[![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions)
[![codecov.io](https://codecov.io/gh/PHPMailer/PHPMailer/branch/master/graph/badge.svg?token=iORZpwmYmM)](https://codecov.io/gh/PHPMailer/PHPMailer)
[![Latest Stable Version](https://poser.pugx.org/phpmailer/phpmailer/v/stable.svg)](https://packagist.org/packages/phpmailer/phpmailer)
[![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer)
[![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer)
[![API Docs](https://github.com/phpmailer/phpmailer/workflows/Docs/badge.svg)](https://phpmailer.github.io/PHPMailer/)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/PHPMailer/PHPMailer/badge)](https://api.securityscorecards.dev/projects/github.com/PHPMailer/PHPMailer)
## Features
- Probably the world's most popular code for sending email from PHP!
- Used by many open-source projects: WordPress, Drupal, 1CRM, SugarCRM, Yii, Joomla! and many more
- Integrated SMTP support – send without a local mail server
- Send emails with multiple To, CC, BCC, and Reply-to addresses
- Multipart/alternative emails for mail clients that do not read HTML email
- Add attachments, including inline
- Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings
- SMTP authentication with LOGIN, PLAIN, CRAM-MD5, and XOAUTH2 mechanisms over SMTPS and SMTP+STARTTLS transports
- Validates email addresses automatically
- Protects against header injection attacks
- Error messages in over 50 languages!
- DKIM and S/MIME signing support
- Compatible with PHP 5.5 and later, including PHP 8.2
- Namespaced to prevent name clashes
- Much more!
## Why you might need it
Many PHP developers need to send email from their code. The only PHP function that supports this directly is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as encryption, authentication, HTML messages, and attachments.
Formatting email correctly is surprisingly difficult. There are myriad overlapping (and conflicting) standards, requiring tight adherence to horribly complicated formatting and encoding rules – the vast majority of code that you'll find online that uses the `mail()` function directly is just plain wrong, if not unsafe!
The PHP `mail()` function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP client allows email sending on all platforms without needing a local mail server. Be aware though, that the `mail()` function should be avoided when possible; it's both faster and [safer](https://exploitbox.io/paper/Pwning-PHP-Mail-Function-For-Fun-And-RCE.html) to use SMTP to localhost.
*Please* don't be tempted to do it yourself – if you don't use PHPMailer, there are many other excellent libraries that
you should look at before rolling your own. Try [SwiftMailer](https://swiftmailer.symfony.com/)
, [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail), etc.
## License
This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read [LICENSE](https://github.com/PHPMailer/PHPMailer/blob/master/LICENSE) for information on the software availability and distribution.
## Installation & loading
PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file:
```json
"phpmailer/phpmailer": "^6.8.0"
```
or run
```sh
composer require phpmailer/phpmailer
```
Note that the `vendor` folder and the `vendor/autoload.php` script are generated by Composer; they are not part of PHPMailer.
If you want to use the Gmail XOAUTH2 authentication class, you will also need to add a dependency on the `league/oauth2-client` package in your `composer.json`.
Alternatively, if you're not using Composer, you
can [download PHPMailer as a zip file](https://github.com/PHPMailer/PHPMailer/archive/master.zip), (note that docs and examples are not included in the zip file), then copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration and load each class file manually:
```php
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'path/to/PHPMailer/src/Exception.php';
require 'path/to/PHPMailer/src/PHPMailer.php';
require 'path/to/PHPMailer/src/SMTP.php';
```
If you're not using the `SMTP` class explicitly (you're probably not), you don't need a `use` line for the SMTP class. Even if you're not using exceptions, you do still need to load the `Exception` class as it is used internally.
## Legacy versions
PHPMailer 5.2 (which is compatible with PHP 5.0 — 7.0) is no longer supported, even for security updates. You will find the latest version of 5.2 in the [5.2-stable branch](https://github.com/PHPMailer/PHPMailer/tree/5.2-stable). If you're using PHP 5.5 or later (which you should be), switch to the 6.x releases.
### Upgrading from 5.2
The biggest changes are that source files are now in the `src/` folder, and PHPMailer now declares the namespace `PHPMailer\PHPMailer`. This has several important effects – [read the upgrade guide](https://github.com/PHPMailer/PHPMailer/tree/master/UPGRADING.md) for more details.
### Minimal installation
While installing the entire package manually or with Composer is simple, convenient, and reliable, you may want to include only vital files in your project. At the very least you will need [src/PHPMailer.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/PHPMailer.php). If you're using SMTP, you'll need [src/SMTP.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/SMTP.php), and if you're using POP-before SMTP (*very* unlikely!), you'll need [src/POP3.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/POP3.php). You can skip the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder if you're not showing errors to users and can make do with English-only errors. If you're using XOAUTH2 you will need [src/OAuth.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/OAuth.php) as well as the Composer dependencies for the services you wish to authenticate with. Really, it's much easier to use Composer!
## A Simple Example
```php
<?php
//Import PHPMailer classes into the global namespace
//These must be at the top of your script, not inside a function
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
//Load Composer's autoloader
require 'vendor/autoload.php';
//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.example.com'; //Set the SMTP server to send through
$mail->SMTPAuth = true; //Enable SMTP authentication
$mail->Username = 'user
没有合适的资源?快使用搜索试试~ 我知道了~
thinkphp6境外商城源码
共2000个文件
php:401个
jpg:400个
js:265个
1星 需积分: 0 10 下载量 52 浏览量
2023-05-19
22:16:03
上传
评论
收藏 60.58MB ZIP 举报
温馨提示
thinkphp6境外商城源码 后台+pc端+手机端 采用响应式布局 可以多用
资源推荐
资源详情
资源评论
收起资源包目录
thinkphp6境外商城源码 (2000个子文件)
00245f3161f05327ca6181b6c04ee25c9b4490 3KB
008d633326622a22d4c4a6a1506370b9f1248c 1KB
00f20ce326cfd124e422cd6d5f24a863ea2595 1KB
01256de761b835bcebdca7190cea7c8e55fe5b 116B
0143b3867f21e7791b8254e806b325c13b2895 675B
0144d619f6bd5f506a826562d4d2ea5c52522c 257B
016a999d543fb7e887bca937014c84997f3261 2KB
017a7d7d57c04dfddb810249e3cafe752bd495 4KB
01b3d6f8636099d64917f082c5b383a43b0ae3 131KB
020cf1dbc0aef2588e807ecfc1067d8ff2256e 6KB
020dbfff7822bf57c7217eafdaa4884b8aa943 207B
022e8b1798f06ee47fa039b13ee661cd42f47e 518B
02558985abaa4dd3e106fc63ddfddf7c7bc8dd 4KB
0289f2f4b5260ce04dd035408961f1e4f2785b 109B
028ea10b69918713d8fbc5b6c3fe6f0ae70eca 1KB
02bb7d8a8df76fbfc7a895a05bc2d0c7532032 6KB
02d4c5c42667a3a2e75ad20365a92f0fcec75e 2KB
032aabd85b43a058cfc7025dd4fa9dd325ea97 187B
03712333761b6ae6f0d0a0e345c9a9678cc596 78B
03df9e535366bcdb6ef8a6317ebe6b13a42e8d 49KB
03f4ec18046807e32690aa7fcd4e4c975a4b7f 1KB
03fddf5900229860f84599a9d676043ed93f44 5KB
04011e3a0b51e2fcde71893494e557c7a09e98 4KB
0421da196380bd572dca6c934b4a22824c6129 4KB
04932d87963bcb063497b1179cee12f407e18a 528B
0516bfdb866b3cc53f13b404c1ba710fb4d049 1KB
0530258f07b59fcc366a8d7ff4d24700454904 116B
05cf5240ffec8c62b65d5d0d8116a4d56a9332 134B
05cf8a2de1fd9d9e21bc3495933502d109abc2 154B
05d44157a96d4b9b57b9307eb70054fa061c28 684B
05da4a0997084dd556d9399029bd3b6a229e90 139B
061e2817c7f84ebe027cf0a559d6acceb6da06 283B
065ae99ccace42df97be8b594049f9f40dcc4f 664B
06e89e25b985b50792b7d1c1f1dad510a8b9ea 2KB
06ebeab99ff3a2ea731db00f24c42a815dfcf1 72B
0741f69667af7b22be892161699bd6a4d7a044 2KB
0753a90ced708f6d8aa20bebf1b36b0d4947d8 3KB
075ad5b398348e8627af4841f6974eea470a15 6KB
07b25ae60ec7e3d32e4027aa6e6b7595de97af 100KB
07e8dd43d9b7cb4a76d9dc1b91d5250ccf272e 217B
083f5cc1f964e5ade7837cee660ba40583a076 269B
087795f7d493d4019bbf067fe2fd5e63442c2f 135B
0891575b0129e1ac25327eebc7cfd856fa2783 569B
08ba5fd70221e983fc3dd02fd71407b71c424b 2KB
08e5c71ddef1b0e6415f7cacfeca1085e62766 4KB
0939995904dedc9c6f86219babbf6c4e04962d 113B
0951e384e66e2cfd93f11d35af1921145b6eaf 215B
09639a532982d43dd17117b136e5dcc007965e 310B
099bbff1a36e3c6ee573c58d3bb47582458a2a 170B
0a0b839033f6cc616820a7aa8be1dae91dc8ec 170B
0a0bd404021e89b6b420a2550f3244e3b1e5df 6KB
0a69453dc5fa68212dc377283fd929c89dc1cb 3KB
0a78eb942da568f9cdac7190c17e23cceda7ed 612B
0acec68cd545a67b5e1243aff93c625d76de75 3KB
0addf983ecb82601ca09c3cb6972272659217b 6KB
0aede90a0954744e1a94b459f3fd13b58e92a7 153B
0b10bdb706f8879bd7c2a6936321f43f2325d1 4KB
0b6b5b79db15e623fa55e5774e5d160b933180 532B
0b9b4a031629bd1e055fdbbf39fd47cdf2cf97 8KB
0bd3fa6b8c96fc012c9c215895f6302b0e0c42 6KB
0be9eae70957e69bb525caee6e99d6a0c3ed37 519B
0c0656a2001b958a127cd9f97b979638c4e75b 111B
0c42f636ea7e1b5e3b739a1b17206eb44b4ce6 75B
0c50259fa6a7a435cafd6ee6d522ef9f98f238 4KB
0c7439db74550bcc4abb1b26ea8d046bbac5a4 6KB
0c888d4bb3520cde6418c087b4548ada3a758b 7KB
0cb71ba9d5f035c358fd8b14010693a74b4775 77KB
0cc7abf5f396b24199f3807cf256a3f5255843 87B
0cf67ba519c6f91f7dd5ceb226d90cc1bb5526 86B
0d00fa8133bfd1c94934fe5200a51fab85590b 193B
0d3c6d68160f1c15a55e73c563cc132dbf4c78 5KB
0d433e29f5ca1ffa6eedaceb70e779e28810d2 4KB
0d434363abd6766f9e8a8c8c9ad7275d23702a 509B
0d6b94726ceccb75df671149488d6ff17e25e8 524KB
0db69aaf53b6be65c2e7ed43db769fb89b47be 6KB
0e26a40abdba2f766b96a7166fc5c27ec482d6 142B
0e3f890ab704a111a382c1a895b334356fbf22 3KB
0e5c37f97631247cd67224a655a176e0cb5fff 170B
0f2702d8b03fa20be70a4d21d0adba869f7c12 49KB
0fad81ff8854ad1877c25ab8a67bb524852504 165B
0ff7961424da8dabee61bfb53158c537e935e1 662B
10086d630f353ac52bf9219f40d4d6f23daf8c 120B
10a3187ac6347505cb15a1b2df436c953eca21 170B
114d5936fe610a672e88e932b5fc3961584324 1KB
118a06e796c1a47122257c641d8ffd3907e6eb 144B
11a5017be2f5ff48cf75f90a83ea4295422733 268B
11c1e20ac7f5a4761049adf5e326654b94069b 637B
11cff9094848517915e595e6a405b050e203fa 1KB
11e66597a0345e3faf1319b5c5f11c4e4e9c91 284B
12018b30c4cdbb228f6724bc8696e64578f0fc 597B
125459f7d593b79cabc75bd60b91943aa65e93 49KB
126bc16de8b06469ff44366ca1b5699360040a 588B
12996a5e3f2bc08b8b8306c320700edf9fb2d3 5KB
12a4e4ad29ab0b3bb6557845ce5dd80e911f80 10KB
12a73bf9628ff5a67b81bd980d9c5d2b2c0f05 490B
12acaa6735610896626fd252541a8401e5c6d6 5KB
12b261e9a1d37bb1866f7ae26b592e057dce3f 13KB
12b4467aed8a437737e60a01076a33c457a61f 8KB
12cf55e0bf6be7f78cfe21c462186a926e8a59 519B
12dfc0775bafff1608c3feef04b95618242c94 3KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
- qq_414807212023-08-20没有数据库文件
weixin_41838270
- 粉丝: 4
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功