I realise that with the newish (introduced in version 3.9) "file" mail transport option can be used to debug mail, but in some cases it's easier if the system actually sends the mail (to me and not the intended precipitant). So I've updated the subversion repository of Kristof Coomans' eZMail Debug patch to work with eZ Publish 4.0.0
To use, simply download the patched ezmail.php from http://pubsvn.ez.no/community/trunk/hacks/ezmaildebug/patches/4.0.0/lib/ezutils/classes/ezmail.php
and save it to lib/ezutils/classes/ezmail.php of your eZ Publish 4.0.0 install.
Remember that if you are using SMTP transport..."Due to a bug in eZ Publish 4.0.0, you need to download the updated version of the "ezsmtp" class and replace the corresponding file in your installation in order to use an SMTP relay server for mail delivery. This bug will be fixed in the upcoming eZ Publish 4.0.1 release." (From http://ez.no/doc/ez_publish/technical_manual/4_0/reference/configuration_files/site_ini/mailsettings/transport )