public void enviarEmail(string assunto, string corpo)
        {
            //create the mail message
            MailMessage mail = new MailMessage();

<span id="more-7"></span>

            //set the addresses
            mail.From = new MailAddress(&quot;&quot;);
            mail.To.Add(&quot;&quot;);

            //set the content
            mail.Subject = assunto;
            mail.Body = corpo;
            mail.Priority = MailPriority.High;

            //send the message
            SmtpClient smtp = new SmtpClient(&quot;&quot;);
            smtp.EnableSsl = true;

            NetworkCredential credenciais = new NetworkCredential(&quot;&quot;, &quot;&quot;);
            smtp.Credentials = credenciais;
            smtp.Send(mail);

        }

Posts Relacionados