bug fix on email sending
Merge branch 'NeilEmaiBranch' into ryan