What have you tried and what issues do you see? Have you runned the code in the debugger? You can't just assume that the "old" code you found on the net works with your ISP. Many ISP's have some kind of anti spam activated in their mail servers.