How to find hostname to POP or IMAP request

This will never work for the reason mentioned in this thread: