Closed (outdated)
Project:
SMTP Authentication Support
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 Dec 2019 at 06:06 UTC
Updated:
9 Oct 2025 at 23:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
andraeray commentedHere is the patch.
I also had to add a new function getToList() to smtp.phpmailer.inc so that I can access the To address which is a private property of the PHPMailer Class.
Comment #3
wundo commentedHi Andrea, thanks for the contribution but I'm not sure why would you need it, also, I think that altering the $mailer object on the fly might be dangerous.
Comment #4
andraeray commentedCan you explain why altering the $mailer object can dangerous?
Here is more of my use case.
SMTP Email Provider 1 - charges $0.10 for 1000 emails. But gets flagged as spam with outlook, and msn, aol, and hotmail recipients.
SMTP Email Provider 2 - charges $1.00 for 1000 emails, and does not get flagged as spam by outlook, msn, aol, and hotmail recipients.
So If I send 25,000 emails per month,
SMTP Email Provider 1 charges $2.50
SMTP Email Provider 2 charges $25.00
If I can swap between provider 1 and 2 based on recipient email, then I can end up spending around $11.50 per month with great deliverability,
That's just one benefit of creating an alter hook that other modules can hook into.
Another benefit would be allowing a user to compare two different SMTP providers during the same time period since the server can switch between them.
Another use case is if a user wishes use their own server for SMTP mails, They can start building it's reputation by sending a small percentage of emails to it and increase it as time goes on.
The alter hook simply just opens the possibility for developers to add new features with having to patch or edit this module's code.
Comment #5
bluegeek9 commentedUnfortunatly, Drupal 7 is End of Life and no longer supported. We strondly encourage you to upgrade to a supported version of Drupal.