I have a function which creates a report and sends it to a user. What I\'ve done is create a mock for the email function, and verify if the \'send\' function of the email class
In the past I have sent real e-mails but I used the decorator pattern on the default EMailGateway implementation.
So I had an EMailGatewayRedirect that would change the recipient to my own address and, in my case, added a line to the top stating that the e-mail is a test and what the original recipient address was.
Since I use a DI container I simply instantiated the redirection gateway as my IEMailGateway implementation in my integration tests. In this way a real e-mail was sent.