Domanda

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.

È stato utile?

Soluzione

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.

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top