hey snajuT, your code is fine and works correctly.
I cut and pasted into my project to test it and it works fine.
Your server may not be set up to send mail like this. You are using SMPT by using this method and your server may not be set up or be able to do it. Not sure exactly why and im sure other people could explain better.
Do a google search.
But as far as your code goes. it is correct and it does work.