in reply to Re^2: correct gmail module?
in thread correct gmail module?

As I said, this was a quickie. It's $imap->to_addresses you'll need to use, rather than $imap->to, and so on. (the second returns parsed objects, the first returns e-mail addresses as strings)