Send all outgoing emails to text file or 1 email address?

edoyax

n00b
Joined
Feb 12, 2003
Messages
17
I want to test a bunch of PHP applications on my test web server that send emails to various email addresses, and instead of them going to the different addresses I would like them to either go to a gmail account or to a plaintext file on the web server.

Does anyone know of a configuration or sendmail replacement that I could use to achieve this?
I am using Windows as the test web server's OS and using SMTP for PHP's mail() function currently.
 
If you want them to go to a gmail account you could just change the to address from the various addresses to the gmail address. If you're getting your various email addresses from a database or something just change the code that you're pulling the email addresses from.

If you want to output the message to a text file you would just have to use fwrite.

http://www.google.com/search?q=php+write+to+a+text+file

http://www.php.net/fwrite

http://www.tizag.com/phpT/filewrite.php

Posting code would be helpful.
 
Well the objective was to not change any code but to change the backend for PHP's mail function.
I have a 100+ scripts that use the mail() function and I don't want to have to switch things around at all. I just need something that will let the mail() function return true as though it sent the message and actually output the message somewhere so I can see it.
 
Back
Top