Download the PHP package hitraa/openforge-mailer without Composer
On this page you can find all versions of the php package hitraa/openforge-mailer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package openforge-mailer
๐ง OpenForge Mailer - PHP SMTP Mailer
A lightweight, dependency-free PHP SMTP Mailer with support for:
- ๐ค Sending plain text and HTML emails
- ๐ Attachments
- ๐๏ธโ๐จ๏ธ Tracking pixel (read/open tracking)
- โ SMTP-level read receipt requests (RCPT NOTIFY)
- ๐ก๏ธ TLS / SSL / STARTTLS support
- ๐ ๏ธ Fallback to native
mail()
on failure - ๐ Debug mode for troubleshooting
๐ Features
- โ Simple API, single class
- ๐ฆ No external dependencies
- ๐ฌ Rich content: Plain text & HTML
- ๐ Attach multiple files
- ๐ Secure with SSL, TLS, or STARTTLS
- ๐๏ธ Tracking pixel integration with your server
- ๐จ Read receipt notification via SMTP
RCPT TO NOTIFY
- โ๏ธ Fallback to native
mail()
if SMTP fails (optional) - ๐งช Debug output for SMTP commands
๐ Example Use Cases
- โ Transactional email sending (invoices, alerts)
- ๐ข Email marketing campaigns (with tracking)
- ๐ฉ Application-based notifications
- ๐งช Development/testing mail delivery
- ๐๏ธ Track when an important email is read
๐ฆ Installation
Copy the Mailer.php
file to your project.
Alternatively, if you're using Composer:
๐ Directory Structure
๐ Usage
1. Basic email
2. With attachments
3. With tracking pixel
Your endpoint should log or store open events using query params like
?message_id=...&email=...
4. SMTP read receipt (SMTP DSN) behavior
Enabling read receipts:
This adds NOTIFY=SUCCESS,FAILURE,DELAY
in RCPT TO
, and the recipient's mail server will notify (if supported).
Also adds optional headers:
Disposition-Notification-To
Return-Receipt-To
X-Confirm-Reading-To
Note: Behavior depends on recipient's server & client.
5. Fallback to PHP mail()
if SMTP fails
6. With custom message id prefix
7. With multiple recipients
Parse RFC email formats
Supports:
Name <[email protected]>
"Name" <[email protected]>
[email protected]
๐ Debugging
Enable SMTP-level debug messages:
This will print the SMTP command flow.
๐ Example File
- ๐
examples/basic-send.php
โ Full example with HTML, text, attachment. - ๐
examples/track.php
โ Tracking pixel handler.
๐ SMTP Security Options
Default port | Option | Description | Mailer constant |
---|---|---|---|
587 | tls |
Default (STARTTLS) | Mailer::SECURE_TLS |
465 | ssl |
SSL connection | Mailer::SECURE_SSL |
587 | starttls |
Explicit STARTTLS | Mailer::SECURE_STARTTLS |
๐ก License
Released under the MIT License
๐จโ๐ป Author
Made with โค๏ธ by Harshal Khairnar Founder, Hitraa Technologies ๐ง [email protected]
๐ค Contributions
Feel free to fork and submit pull requests. All improvements are welcome!
โ ๏ธ Disclaimer
This library is designed for educational and production-ready purposes. Use responsibly when tracking user interactions.