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

Fixes #517 'emailpmnotify' causes SQL error