Ejemplo n.º 1
0
        public void SendEmail(string para, string assunto, string conteudo, Tipos.FormatoEmail formato, List <string> bcc = null)
        {
            MailMessage m  = new MailMessage();
            SmtpClient  sc = new SmtpClient();

            m.From       = new MailAddress("*****@*****.**");
            sc.Host      = "mail.rankingdetenis.com";
            sc.Port      = 25;
            sc.EnableSsl = false;
            m.To.Add(para);
            m.Subject = assunto;
            m.Body    = conteudo;
            if (formato == Tipos.FormatoEmail.Html)
            {
                m.IsBodyHtml = true;
            }
            else
            {
                m.IsBodyHtml = false;
            }
            sc.Credentials = new System.Net.NetworkCredential("*****@*****.**", "@abc5826");
            try{
                sc.Send(m);
            } catch (Exception ex) {
                throw ex;
            }
        }
Ejemplo n.º 2
0
        public Mail(string de, string para, string assunto, string conteudo, Tipos.FormatoEmail formato, List <string> bcc = null)
        {
            this.de       = de;
            this.para     = para;
            this.assunto  = assunto;
            this.conteudo = conteudo;
            this.formato  = formato;
            this.bcc      = bcc;

            Usuario  = System.Configuration.ConfigurationManager.AppSettings.Get("UsuarioMail");
            Senha    = System.Configuration.ConfigurationManager.AppSettings.Get("SenhaMail");
            SMTPPort = System.Configuration.ConfigurationManager.AppSettings.Get("PortaSMTP");
            HostIP   = "mail.rankingdetenis.com"; //System.Configuration.ConfigurationManager.AppSettings.Get("ServidorSMTP");
        }