Want sent person details in sent folder of mail

Task:user opens “sent” folder of mail file(this mail file is common mail file used by many users in organisation) and selects some sent mails (for eg say 50 sent mails) and then run an agent from the Actions menu to know how many mails sent by each user in those 50 mails.(user should be displayed like this : smith sent 30 mails, john 14 mails and mary 6 mails).Can someone send code for this