Slight changes to email message sending code