Avoid `referenced before assignment` error
when smtp server is not available