Disable Outgoing Mail in Drupal 7

* Implements hook_mail_alter
function yourmodule_mail_alter(&$message) {
// set ‘To’ field to nothing, so Drupal won’t have any address
$message[‘to’] = ‘ ‘;

Other Way you can do

If using devel with drupal 6, add to settings.php
$conf[‘smtp_library’] = ‘sites/all/modules/devel/devel.module’;

and all outgoing emails get logged in watchdog.

If using devel with in drupal 7, if you add
$conf[‘mail_system’] = array(‘default-system’ => ‘DevelMailLog’);

emails get written to files in the drupal temporary directory.

Re-route All Emails Using Reroute Email Module

Download and install the Reroute Email module.

Go to Configuration-> Reroute Email (admin/config/development/reroute_email).

And  than Check the Enable rerouting checkbox and enter in an email address into the Email addresses text field.