private void btnSend_Click(object sender, EventArgs e)
 {
     try
     {
         lblMensaje.Text = "";
         co.From         = "*****@*****.**";
         co.To           = tbxTo.Text;
         co.Cuerpo       = tbxcuerpo.Text;
         co.Password     = "******";
         if (cbo.EnviarCorreo(co))
         {
             MessageBox.Show("Correo Se envio con exito");
             this.DialogResult = DialogResult.OK;
             //this.Close();
         }
         else
         {
             MessageBox.Show("Problemas al enviar el correo");
         }
     }
     catch (Exception ex)
     {
         string pattern = "[0-9]*:";
         Regex  rgx     = new Regex(pattern);
         lblMensaje.Text = rgx.Replace(ex.Message, "");
     }
 }
Пример #2
0
 /// <summary>
 /// va al metodo para enviar el mensaje
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnEnviar_Click(object sender, EventArgs e)
 {
     co.EnviarCorreo(Body, txtasunto.Text, txtdestinatario.Text, txtRuta.Text);
 }
Пример #3
0
 private void btnEnviar_Click(object sender, EventArgs e)
 {
     co.EnviarCorreo(txtemisor.Text, txtcontrasena.Text, Body, txtasunto.Text, txtdestinatario.Text);
 }