Fix email sending bug. (helpdesk ticket 30905)
Bug fixes