sorry if I was not clear in my post. I dont want to implement a mail client. All that I wanted to mention was that I was able to log into atleast one secured website (https://mail.yahoo.com) with the code I had.
The url I want to access gets redirected. Please look at the bottom part of my post. I explained my issues in details.