Depends how you used it, you can't say "the doctors recommends me to swim", it has to be "recommends that I swim".
But why? Is it grammatically incorrect in English to say "recommends to swim"? Or it's not a correct translation of the original Hebrew sentence?
It takes ל before the name of the person TO WHOM you recommend ( or suggest) something and על before WHAT you are revommending : for example " אני ממליץ לך על המסעדה הזאת"