The thread
Email accounts (Email POP3) has a lot of useful information (and some links to further information) about this kind of thing. There is also the script
[RELEASE] Gmail Checker 1.10 - get alerts upon new emails in your gmail accounts. Honestly I haven't used the script so I am unsure how it is and if it works correct (I assume it does). I hope this gives you the information you were after. If you need further explanation or assistance, feel free to post again and we will see if we can help.
EDIT: There does seem to be some support for yahoo as well, unlike what is stated in one of the linked threads. Information can be found on
this page. Please just realise that although it is talking about Microsoft Outlook that the information about the countries and the POP3 and SMPT server addresses are universal and still relate to you (and are what you are to use I presume).