Fixed #504

Created a default/ fall back password algorithm.
fixed a minor bug introduced in the last commit.
Add "mail" as default email sending method in scheduled email
Change mysql NOW() to php date

In case of DB and PHP on the different timezone, e.g. different setting
or different server, using NOW() will cause problem.
fixed email schedule's getEmailsToSend function
Merge branch 'hotfix' into dev