Fix missed db connection in escaping values when storing notification
Add initialization of 'sendmail_from' PHP variable

This is a workaround for some systems that requires this variable to be set explicitly for sending emails (thanks to falcon for the issue)