I have to send PHPMailer-om written a function that contains all the common operations, and as parameters transmitted only what differs from letter to letter: to, subject, from whom, etc as for the sending options.
Settings for SMTP I keep in the local file.ini, which contains also all other parameters that differ for development and prоduction. This file should not be updated automatically, neither via FTP nor via git.
PHPMailer reads data from it, and so on customer's server sends the emails through another SMTP with a different sender. Of course, this requires that the customer reported their data access.
But this is my personal way, maybe, is even better.