Replace SC_Query with DB at class Model\Customer\MailHistory.