Buscar

EnviarEmail

Esta é uma pré-visualização de arquivo. Entre para ver o arquivo original

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace EnviarEmail
{
 public partial class Form1 : Form
 {
 public Form1()
 {
 InitializeComponent();
 }
 private void btnenviar_Click(object sender, EventArgs e)
 {
 enviar classe = new enviar();
 classe.email(txtEmail.Text, txtassunto.Text, rtxtmensagem.Text, txtanexo.Text);
 if(enviar.teste== true)
 {
 MessageBox.Show("Email enviado com sucesso");
 }
 else
 {
 MessageBox.Show("Erro ao enviar email");
 }
 }
 private void btnanexo_Click(object sender, EventArgs e)
 {
 OpenFileDialog open = new OpenFileDialog();
 if (open.ShowDialog() == DialogResult.OK)
 {
 txtanexo.Text = open.FileName;
 }
 }
 private void Form1_Load(object sender, EventArgs e)
 {
 }
 }
}

Teste o Premium para desbloquear

Aproveite todos os benefícios por 3 dias sem pagar! 😉
Já tem cadastro?

Continue navegando