Jump to content

Extending the phpMailer Class


iwato

Recommended Posts

BACKGROUND:  I use phpMailer in multiple locations or multiple purposes on my website.  For example, sometime it is a mass mailing that requires a connection to my MySQL data base, sometimes it is a simple one-on-one communication between me and a new visitor,  sometimes the sender is newsletter@grammarcaptive.com, and other times the sender is admin@grammarcaptive.com, etc.

Now, I develop in a folder that is a subdomain of the main domain of my webpage.  As a result, the path to my Composer installation is different for my development and production sites, and I cannot simply copy from my subdomain to my main domain and expect anything to work.  In order to avoid the resulting path problem I would like to extend the phpMailer class.

In addition, I would like to avoid the redundancy of copy and paste for everything required to make phpMailer work.  For example, one can expect that SMTP server settings will always be the same and the reply recipient is not expected to change. Further, the data base when it is used will always be the same, even though the table is likely to change.

REQUEST:  Could you sketch in code form what a plausible class arrange would be?

NOTE:  That last time i tried this it failed, for a lack of a proper outline.

Roddy

Edited by iwato
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...