search
Homephp教程php手册Super beautiful and convenient email sending extension tp-mailer, supports all frameworks

All ThinkPHP version frameworks and any other PHP framework are supported, and automatic loading files are supported manually
, easy to use, powerful, supports ThinkPHP's own template engine, supports HTML templates, supports plain text templates, also supports sending attachments with Chinese characters, supports embedding image metadata in emails, code calls consistently, super beautiful, developed based on SwiftMailer
Let’s take a look at the elegant use first: use mailertp5Mailer;<br> <br> $mailer = Mailer::instance();<br> $mailer->from('tianpian0805@gmail.com', 'yuan1994')<br> ->to('your-mail@domain.com')<br> ->subject('Plain text test')<br> ->text('Welcome to use Tp Mailer')<br> ->send();require_once '/path/to/tp-mailer/src/autoload.php';<br> <br> use mailertp32Mailer;<br> <br> $mailer = Mailer::instance();<br> $mailer->from('tianpian0805@gmail.com', 'yuan1994')<br> ->to('your-mail@domain.com')<br> ->subject('Multi-line text test')<br> ->line('PHPers: ')<br> ->line('Welcome to use Tp Mailer, if you find it useful, please give it a star, and you are also welcome to Fork to help improve it')<br> ->line()<br> ->line('yuan1994 <tianpian0805 . date></tianpian0805> ->attach('/path/to/filename.pdf', 'customized filename.pdf')<br> ->send();require_once '/path/to/tp-mailer/src/autoload.php';<br> <br> use mailertp31Mailer;<br> <br> $mailer = Mailer::instance();<br> $mailer->send(function($mailer, $message) {<br> $mailer->to('tianpian0805@gmail.com')<br> ->subject('Use the framework template engine to render template tests')<br> ->view('mail:test', array(<br>              'param1' => 'Parameter 1',<br>              'param2' => 'Parameter 2',<br>             'embed:image' => ROOT_PATH . 'image.jpg',<br> ));<br> });Installation:
Install using Composer (highly recommended):

Support psr-4 specification, ready to use out of the box

composer require yuan1994/tp-mailer
Download from github or download the source code directly manually:
Need to manually import the automatic loading file
Download file:

git clone https://github.com/yuan1994/tp-mailer tp-mailer

git clone https://github.com/swiftmailer/swiftmailer swiftmailer

Or click to download directly:

https://github.com/yuan1994/tp-mailer/archive/master.zip

https://github.com/swiftmailer/swiftmailer/archive/5.x.zip

Move folder:

Then manually name the two projects tp-mailer and swiftmailer respectively, and place them in the extension class library folder of your own project. These two folders must be in the same directory. The directory structure is roughly as follows:

Extension catalog
├── tp-mailer
│ └── src
├── swiftmailer
│ ├── lib
│ ├── doc
│ └── tests
Introduce autoloading files:

Import it when using it or automatically import it globally

require_once '/path/to/tp-mailer/src/autoload.php;


Project address:
https://github.com/yuan1994/tp-mailer

Document address:
https://github.com/yuan1994/tp-mailer

If you have any questions, please submit Issues
https://github.com/yuan1994/tp-mailer/issues

Other project recommendations:
tpAdmin: Backend management framework based on tp5 that supports automatic code generation and Rbac permission management
https://github.com/yuan1994/tpAdmin

WeChat_Web_Devtools Linux version: WeChat applet development tool that perfectly supports Linux system:
https://github.com/yuan1994/wechat_web_devtools

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool