Exemple #1
0
        public CReportDispatcher(/*IAlarmable*/ IClientReportDispatcher client, /*IDBCommunicator*/ IDBCommunicatorForReportDispatcher dbcommunicator, bool useRealServer,
                                 int stockExchangeId) : base(client)
        {
            _useRealServer = useRealServer;

            _client = client;
            //CReportDataAccounts reportData = new CReportDataAccounts(_useRealServer);
            //_pdfGeneratorAccounts = new CPDFGeneratorAccounts(reportData,_useRealServer);



            _dbCommunicator = dbcommunicator;

            /*   _mailer = new CMailer( smtpServer: "smtp.bk.ru",
             *                         portSMTP: 587,
             *                         user: "******",
             *                         mailDomain: "bk.ru",
             *                         password: "******",
             *                         alarmer: client,
             *                         bUseEamilAsUserName:false,
             *                         bEnableSSL:true);
             *
             */


            _mailer = new CMailer(smtpServer: "ctc-trade.com",
                                  portSMTP: 587,
                                  user: "******",
                                  mailDomain: "ctc-trade.com",
                                  // password: "******",
                                  password: "******",
                                  alarmer: null,
                                  bUseEamilAsUserName: true,
                                  bEnableSSL: false);



            (new Thread(ThreadDispatch)).Start();
            _stockExchId = stockExchangeId;
        }
        private static void TestMail()
        {
            //string filename = "D:\\ATFS\\Data\\zTest\\2016\\09\\22\\100.pdf";

            string filename = @"e:\ATFS\Data\TradeSystemCrypto\Reports\2018\09\19\101.pdf";

            //   string filename = @"E:\ATFS\Data\TradeSystemCrypto\Reports\2018\09\28\101.pdf";


            //string filename = @"D:\ATFS\Data\TradeSystem\2016\09\22\100.pdf";

            /* CMailer mailer = new CMailer(smtpServer: "smtp.bk.ru",
             *                       user: "******",
             *                       mailDomain: "bk.ru",
             *                       password: "******",
             *                       alarmer: null);
             *
             */
            CMailer mailer = new CMailer(smtpServer: "ctc-trade.com",
                                         portSMTP: 25,
                                         user: "******",
                                         mailDomain: "ctc-trade.com",
                                         //password: "******",
                                         password: "******",
                                         alarmer: null,
                                         bUseEamilAsUserName: true,
                                         bEnableSSL: false);



            mailer.SendMail(
                toAddress: "*****@*****.**",
                //toAddress: "*****@*****.**",
                title: "Название отчета",
                stContent: "Содержание отчета",
                fileName: filename


                );
        }