Many professors really appreciate a heartfelt thank you letter. This kind of letter is generally longer and more formal than a quick email.