Hello Dr.XX:
Hope you enjoy your vacation.
I am XX, one of your students in XX in XX 20XX. I am writing to ask if you would be willing to write a letter of recommendation for me.
I am planning to graduate in the following semester and want to apply for master in XX in some universities in XX 20XX. I knew it might be a challenge for a XX major's student but I want to try it. I made many preparations this summer to meet the prerequisites of the master in XX and thought XX is the course which can partly match the program. Though I am not the best in your course, I still learned a lot and communicated with you face-to-face which let me know what I can do to improve myself.
I am really sorry that I cannot contact with you face to face earlier since I have returned China for several months. It would be of great help if I could receive a letter of recommendation from you in support of the application. I would really appreciate it.
Herewith I also send my resume with more detailed information. Some of the universities I plan to apply have the deadline in XX. Therefore, please let me know if you are willing to write me a recommendation letter and contact with me.
Best,
XX XX