Fixed #23924 -- Made EmailMessage raise TypeError for type checks