How to inspect outgoing email content during a SimpleTest?
Simpletest automatically captures sent mails during a test and allows you to fetch them using $this->drupalGetMails() in the test class.

I did something like this recently in tests I wrote for the Simplenews project, to test subscription confirmation here.