Вопрос

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.

Это было полезно?

Решение

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.

Другие советы

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top