Fixes #517 'emailpmnotify' causes SQL error
Merge pull request #609 from PaulBender/fix-feature-517

Fixes #517 'emailpmnotify' causes SQL error