Walmart has apologized to people who received emails containing the n-word in an earlier message from the retailer.