Fix command line error

closes #1871
- added check for mailConfig
Merge pull request #1872 from sebgie/issue#1871

Fix command line error