Correct an error in email sending if parameter is None