Override php function

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Hi, I'm need to test a php script that sends email messages, I'm using
a windows local machine (without internet connection), so I can't set
an smtp server in php.ini, but I need to see the content of the
messages, so I think I have three choices: (1) get something like a
"sendmail" emulator that stores the messages in files instead of
sending them, (2) install a smtp server, (3) the easiest I think,
override the mail() function with a function that doesn't send
anything, just stores the parameters in a database or a file.

The script is a complex shopping cart, and it sends the
username/password to the email when a user sign up, so I can't create
test accounts because I can't receive email message with the password
and it is stored encrypted in the database. Also I must implement
other funcionalities that include send email, and I need to see how
the messages are sent.



Site Timeline