in reply to Capturing Email During Testing

About a different method for capturing email in a test framework... I've had great success (and fun) with "fakemail" http://www.lastcraft.com/fakemail.php. It sets up an SMTP server on localhost and anything that gets "mailed" to it ends up in a separate file in a directory of your choosing.

I just have the following two line in my code and I toggle the comment depending on whether I'm testing or not:

MIME::Lite->send( smtp => 'real.smtp.server.net' ) ; # MIME::Lite->send( smtp => 'localhost:10025' ) ;
If you can't toggle the comments, you can change the network. Add an entry in /etc/hosts (or whatever your equivalent is) so "real.smtp.server.net" resolves to localhost and use fakemail running on port 25.

Although that might just confirm: "There's more than one way to do it" doesn't always mean there's more than one way you should do it.