fixed sending HTML notifications and improve error handling in daemon_send_message