| « DKIM and Callback function for PHPMailer | Gmail Server Changes ... » |
PHPMailer Lite
I have received quite a few PHPMailer requests for an even simpler solution.
Most of the requests fall into a common thread: those using PHPMailer with a forms handling package (like PHPMailer-FE) or their own scripts to process forms on their website are looking for a simple tool to forward their forms-to-email data. They want to maintain the ability to have attachments, text and HTML, and simple setup.
I am working on a PHPMailer Lite where the setup is really simple. Here's what it looks like:
require_once 'class.phpmailer-lite.php';
$mail = new PHPMailer();
$mail->SetFrom('andy.prevost@worxteam.com', 'Andy Prevost');
$mail->AddAddress('name1@doedomain.com', 'John Doe');
$mail->AddAddress('name2@doedomain.com', 'Joe Doe');
$mail->AddBcc('myname@mydomain.com', 'James Doe');
$mail->Subject = 'PHPMailer Lite Test Subject via Sendmail';
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML(file_get_contents('contents.html'));
$mail->AddAttachment('images/phpmailer.gif'); // attachment
$mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
$mail->Send();
Several things to notice:
- there is no Reply-To
- there is no Sender
- there is no send type
Those are automatically set.
For a simplified system, I have modified PHPMailer into a PHPMailer Lite version based on the feedback I have been getting. Essentially, the initial specs:
- Sendmail is the default mail type (also supports Qmail, mail())
- SMTP removed
- Automated "Reply-To", "Return-path" if not in setup
- Optional ability to specify mail type (Sendmail/Qmail is default, mail() can be specified)
- Maintained the rich feature set of PHPMailer in the Lite version (encoding, attachments, multi-mime, etc.)
- Reduced footprint to 62 kb, no additional files required
- Default to SingleTo as true (regardless of the number of To: email addresses, sends one per email address)
These basic features seem to address the requirements of small to mid-size users plus easily handles the forms-to-email users. The Lite version is not designed for large mailing lists where the load-balancing features of SMTP mail is useful. It can be used for small mailing lists.
If anyone is interested in Beta testing, send me an email.
Andy