Well of course you can always rent a private yatch or sail boat and sail along the French Riviera in the Mediterranean Sea for approximatelly two hours. But if you are more on the budget, or on a short time schedule like I was, I would recommend the following.
Take the Interline train from Gare de Nice Ville Station to St Raphael. It will take you approximately 1 hour and 15 minutes. The scenery is quite nice, and the train rides along the coast of the French Riviera, passing by Antibes and Cannes.
Upon arrival to St Raphael(photo below) walk out of the station and turn right towards the water. Only three blocks away you will find the Bateaux to St Tropez.