Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In my development PC I want to see all mail sent using PHP mail() function. Is there any dummy mail server that could show all sent mail (regardless of their recipient) and collect them in a mail box to preview?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

Here you go: smtp4dev

Windows 7/Vista/XP/2003/2010 compatible dummy SMTP server. Sits in the system tray and does not deliver the received messages. The received messages can be quickly viewed, saved and the source/structure inspected. Useful for testing/debugging software that generates email.

share|improve this answer

phi's solution is great if you have a Windows environment.

If you have a Linux environment - then you can setup postfix to deliver all email to a local mailbox.

Here is a link to get you started - http://serverfault.com/questions/144325/how-to-redirect-all-postfix-emails-to-one-external-email-address

Create /etc/postfix/virtual-regexp with the following content:

/.+@.+/ email@gmail.com
Edit /etc/postfix/main.cf and add regexp:/etc/postfix/virtual-regexp to the virtual_maps configuration. The end result might look like this in main.cf:

virtual_maps = hash:/etc/postfix/virtual, regexp:/etc/postfix/virtual-regexp
Build the mapfile by typing:

postmap /etc/postfix/virtual-regexp
This also requires a virtual.db to exist. If it doesn't create an empty file called virtual and run : postmap /etc/postfix/virtual

Voila!
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.