Hi Rahul,
Does your System Under Test really have a full “email server” as a component? Or is the System Under Test behaving like an “email client” and it has a dependency onto an email server where it sends its generated email to?
In the case there is actually an email server inside the System Under Test then the solution would be to have some custom scripting (e.g. Execute Script step) inside a testcase. The scripting would use the POP3 protocol to query the email server and “get a new email”. Inside the testcase there would be a loop around this script step to get all the new messages and do the counting. So, not a virtual service because the requirement is not to listen for new emails, the requirement is to poll the email server for new messages. The testcase can then be scheduled within CVS e.g. once every minute, as that makes the counting and reporting of the new emails more controllable. The testcase could insert the count into a database table, or create a report file on disk. A database table would be easier to make aggregate reports.
In the case there is no email server inside the System Under Test (and there is none within the test environment that can be used) then your application is just an email client and it needs to connect to a virtual email server. In that case there is a need for a custom SMTP Transport Protocol Handler that can be run inside a .vsm. We are not aware of such an implementation.
Cheers,
Danny