Jump to content

Extending the phpMailer Class

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.


Edited by iwato

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...