If you have A/A- in my class, then if I have time I will write it. If your grade is B+/B/B-, email me what you are applying for, and why you ask me for recommendation. But usually it should work too.
Please try avoid last day emails about recommendations even if you were the best student in a class.