Ejemplo n.º 1
0
        public ParamServerMail GetParamServerMail()
        {
            Models.Entities   sql = new Models.Entities();
            CatchMe_ParamMail pm  = sql.CatchMe_ParamMail.Select(x => x).FirstOrDefault();

            ParamServerMail psm = new ParamServerMail();

            if (pm != null)
            {
                psm.Smtp        = pm.smtp;
                psm.Default_exp = pm.default_exp;
            }

            return(psm);
        }
Ejemplo n.º 2
0
        public ServeurInfo()
        {
            this.server = "smtp.tse.fransbonhomme.fr";

#if NET35
            BasicHttpBinding customBinding = new BasicHttpBinding();

            string env = null;
#if DEBUG
            env = "localhost:2010";
#else
            env = "catchexception";
#endif

            string url = $"http://{env}/ParamMail.svc";

            EndpointAddress endpointAddress = new EndpointAddress(url);
            IParamMail      ws = new ChannelFactory <IParamMail>(customBinding, endpointAddress).CreateChannel();

            ParamServerMail pm = ws.GetParamServerMail();
            server = pm.Smtp;
            from   = pm.Default_exp;
#endif
        }