send mail automatically
clean code: better if statement