Seeing how the OP came here wanting help for Gmail, and Gmail being the only popular web email service out there that offers SMTP/POP3 access (for free), I'd say the foolish thing would be to bother tackling Hotmail.

Since you're not too familiar with sockets, I wonder why you would suggest using sockets since that would be the hardest way of approaching a javascript enriched email service? The easiest method here would be just to use nHTML imo.