Reputation: 1279
I have phpmailer working on my system already. I am updating some code that uses it to send out emails, I just need to test to make sure that the update sends the correct information, but not send out actual emails as it sends them out to hundreds of people.
Is there a quick way to redirect phpmailer to a file, or better yet if phpmailer uses sendmail, to have that command redirect to a file? This is a test server, so it would be best if all mail functionality was redirected to a file or something.
Upvotes: 2
Views: 1472
Reputation: 53
You can Use MailHog
https://github.com/mailhog/MailHog
Just Setup MailHog In Your Application and just set configuration in your PHPMailer Like Host => 'mail' Port => 1025
Upvotes: 0
Reputation: 11347
You can set sendmail_path
in php ini to whatever you want. For example, it can be tee -a mail.log
so that everything gets logged to a file.
Upvotes: 4