mouldy strawberries

I'm really new to gardening, i have some hanging baskets with strawberries in them and i do seem to be getting quite a lot of flowers but it seems that a lot of the fruit are going mouldy before they ripen... any ideas?

Explore some of Ireland's most breathtaking gardens on an exclusive four-night tour. Special guest Monty Don will join you for a garden tour and give an entertaining evening talk on his gardening life. Flights, four-star hotel, breakfast and four additional meals included, prices start from £2,265 per person.