Download the PHP package webservco/mail without Composer
On this page you can find all versions of the php package webservco/mail. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download webservco/mail
More information about webservco/mail
Files in webservco/mail
Package mail
Short Description A PHP component/library. Saves outgoing emails in a database table and sends them later from a scheduled job using PHPMailer.
License MIT
Homepage https://webserv.co
Informations about the package mail
webservco/mail
A PHP component/library. Please see webservco/sandbox for an example project using these types of components.
Saves outgoing emails in a database table and sends them later from a scheduled job using PHPMailer.
- Requires: the
mailingtable (structure), a PDO container fromwebservco/database - Related:
webservco/command(the sending job runs as a command and reports what it processed)
Installation
Usage
Add an email to the queue
Send the queue
Run this from a command on a schedule (cron).
Your factory creates Service\Processor\MailingProcessor with a report, a logger, MailItemEntityStorage, MailItemStorage, a pause in seconds between emails, and a configured PHPMailer (SMTP settings and sender).
Contracts
| Interface | Implementation | Purpose |
|---|---|---|
Contract\Service\Storage\MailItemStorageInterface |
Service\Storage\MailItemStorage |
Adds emails and marks them as sent or failed. |
Contract\Service\Storage\MailItemEntityStorageInterface |
Service\Storage\MailItemEntityStorage |
Iterates emails that haven't been sent. |
Contract\Processor\MailingProcessorInterface |
Service\Processor\MailingProcessor |
Sends each unsent email and counts the results. |
Contract\Service\MailingTableNameServiceInterface |
Service\MailingTableNameServiceFromConfig |
Table name, from the configuration. |
Contract\Factory\MailingProcessorFactoryInterface |
your factory | Creates the processor. |
Contract\Factory\PHPMailerFactoryInterface |
your factory | Creates a configured PHPMailer. |
Namespaces are relative to WebServCo\Mail\.
Configuration
The table can have any name.
Notes
Messages are sent as HTML. to takes exactly one address, while cc and bcc take several, separated by commas.
When sending fails, the error goes into error_message and the email stays unsent. The next run tries it again, and the one after that, with no limit. Check the error column now and then for addresses that will never work.
The processor clears PHPMailer's recipients after each email.
Development
License
MIT
All versions of mail with dependencies
phpmailer/phpmailer Version ^6
psr/log Version ^3
webservco/configuration Version ^2
webservco/command Version ^2
webservco/data Version ^2
webservco/database Version ^2