Search code examples
phpmailer

is it possible to log sent mails with phpmailer on webserver


I am using phpmailer 6.5.0. Are the sent emails stored on the server in any way? To put it another way, could the administrator by the webservices see the mail traffic afterwards?

best regards

claus


Solution

  • The web server will not log SMTP traffic (though it would log any HTTP requests that triggered message sends), but if you relay through a local mail server (as is recommended), then the mail server will have logs of both message submission and onward delivery.

    You can of course add logging at various levels of detail, either by logging things yourself (e.g. whenever you call send(), or perhaps using the Debugoutput property to inject a callable.