Hello,

I need to register a javax.mail.event.TransportListener with the test layer of my Spring application in order to be able to determine whether or not emails are being sent.

I noticed that I can get a javax.mail.Session from a javaMailSenderImpl and in turn I can get a javax.mail.Transport from the Session and I could add a TransportListener to this Transport instance.

Does it make sense to do all this from the test class?

Can anyone please provide advice?

Regards,

Julien.