In a heavy saucepan, combine sugar, cocoa, cornstarch and salt. Gradually add milk. Bring to a boil over medium heat; boil and stir for 2 minutes. Remove from the heat; stir in butter and vanilla. Spoon into individual serving dishes. Chill until serving. If desired, garnish with whipped cream and M&M's.