Preheat oven to 350°F (177°C). Grease a 9x13-inch (23x33cm) pan.
Sift together flour, cocoa powder, baking powder, baking soda, and salt into a large bowl.
In a separate bowl, combine sugar, mayonnaise, water, and vanilla. Add wet ingredients to dry and beat just until smooth and combined.
Pour batter into prepared pan and smooth the top.
Bake 30–35 minutes, or until a toothpick inserted in the center comes out clean. Cool completely before icing.
Melt butter in a medium saucepan over medium heat.
Add sugar and stir to coat in the butter.
Add milk and whisk until combined.
Add cocoa and whisk well until no dry pockets remain.
Bring to a boil, stirring continuously and scraping down the sides. Boil for 3 minutes, continuing to stir.
Remove from heat once the mixture reaches 235–240°F (112–115°C). For a softer fudge, pull it closer to 235°F. For clean, firm lines when you cut, aim for the higher end of the range.
Let cool for 3–5 min until it reaches ~ 200°F, then pour over fully cooled cake and let set.
