Changed conditions for sending email