Ejemplo n.º 1
0
        public async Task Send(Participant santa, string body)
        {
            using (var emailClient = new SmtpClient())
            {
                emailClient.AuthenticationMechanisms.Remove("XOAUTH2");

                await emailClient.ConnectAsync(HOST, PORT, true);

                await emailClient.AuthenticateAsync(SMTP_USERNAME, SMTP_PASSWORD);

                var msg = new MimeMessage();
                msg.To.AddRange(new List <MailboxAddress> {
                    MailboxAddress.Parse(santa.Email)
                });
                msg.From.AddRange(new List <MailboxAddress> {
                    MailboxAddress.Parse(Config.Instance.SmtpEmail)
                });
                msg.Subject = Config.Instance.MailSubject;
                msg.Body    = new TextPart(TextFormat.Html)
                {
                    Text = body
                };

                try
                {
                    await emailClient.SendAsync(msg);

                    Console.WriteLine($" > {santa.Email}: ok! ");
                }
                catch (Exception ex)
                {
                    // todo put this in a log file
                    Debug.WriteLine($"{santa.Email} - Error when sending mail");
                    Debug.WriteLine($"{santa.Email} - Exception: " + ex.InnerException?.Message ?? ex.Message);
                }
                finally
                {
                    await emailClient?.DisconnectAsync(true);
                }
            }
        }
Ejemplo n.º 2
0
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("Представник сайту", "*****@*****.**"));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync("smtp.gmail.com", 465, true);

                await client.AuthenticateAsync("*****@*****.**", "AZAZAZ090@");

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
Ejemplo n.º 3
0
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("Адміністрація сайту", "*****@*****.**"));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync("smtp.gmail.com", 465, true);

                await client.AuthenticateAsync("*****@*****.**", "56Comanche");

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("Website Admin", "*****@*****.**"));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync("smtp.mail.ru", 25, false);

                await client.AuthenticateAsync("*****@*****.**", "YourEmailPassword");

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
Ejemplo n.º 5
0
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("StudentsAccounting.com", _emailSettings.Sender));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync(_emailSettings.MailServer, _emailSettings.MailPort, false);

                await client.AuthenticateAsync(_emailSettings.Sender, _emailSettings.Password);

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
Ejemplo n.º 6
0
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("My forum", "*****@*****.**"));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync("smtp.ukr.net", 465, true);

                await client.AuthenticateAsync("*****@*****.**", "f9nvhpPRcvaQZkE1");

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
Ejemplo n.º 7
0
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("Администрация сайта VkGraber", "*****@*****.**"));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync("smtp.mail.ru", 465, true);

                await client.AuthenticateAsync("*****@*****.**", "FmmK31LS");

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
Ejemplo n.º 8
0
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("FiorelloC", "*****@*****.**"));
            emailMessage.To.Add(new MailboxAddress(string.Empty, email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync("smtp.mail.ru", 465, true);

                await client.AuthenticateAsync("*****@*****.**", "IA2UoIuory6_");

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
Ejemplo n.º 9
0
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("Site Administration", "*****@*****.**"));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync("smtp.mail.ru", 25, false);

                await client.AuthenticateAsync("*****@*****.**", "Smlftguy03082002");

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
Ejemplo n.º 10
0
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("Site administration", ConfigurationManager.AppSettings["login"]));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync(ConfigurationManager.AppSettings["server"], int.Parse(ConfigurationManager.AppSettings["port"]), false);

                await client.AuthenticateAsync(ConfigurationManager.AppSettings["login"], ConfigurationManager.AppSettings["password"]);

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
Ejemplo n.º 11
0
        public async Task SendAsync(string subject, string message, string email)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress(EmailSettings.headerAdministrationSite, ""));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync(EmailSettings.smtpAdress, EmailSettings.port, EmailSettings.cancellationToken);

                await client.AuthenticateAsync(EmailSettings.userSender, EmailSettings.passwordSender);

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
Ejemplo n.º 12
0
        //public static void Send(string email, string subject, string message)
        //{
        //    var emailMessage = new MimeMessage();
        //    emailMessage.From.Add(new MailboxAddress("tianwei blogs", "*****@*****.**"));
        //    emailMessage.To.Add(new MailboxAddress("mail", email));
        //    emailMessage.Subject = subject;
        //    emailMessage.Body = new TextPart("plain") { Text = message };

        //    using (var client = new SmtpClient())
        //    {
        //        client.Connect("smtp.hantianwei.cn", 465, true);
        //        client.Authenticate("*****@*****.**", "******");

        //        client.Send(emailMessage);
        //        client.Disconnect(true);

        //    }
        //}

        public static async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("tianwei blogs", "*****@*****.**"));
            emailMessage.To.Add(new MailboxAddress("mail", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart("plain")
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync("smtp-mail.outlook.com", 587, SecureSocketOptions.StartTls).ConfigureAwait(false);

                await client.AuthenticateAsync("*****@*****.**", "oracle2010");

                await client.SendAsync(emailMessage).ConfigureAwait(false);

                await client.DisconnectAsync(true).ConfigureAwait(false);
            }
        }
Ejemplo n.º 13
0
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("15Puzzle", "*****@*****.**"));
            emailMessage.To.Add(new MailboxAddress("BB", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync("smtp.gmail.com", 465, true);

                await client.AuthenticateAsync("*****@*****.**", "Ithieyjdbx1993");

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("Administration", "*****@*****.**"));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync("smtp.gmail.com", 587, false);

                await client.AuthenticateAsync("*****@*****.**", "Sevchanskyy");

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("Поликлиника", email));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync("smtp.gmail.com", 587, false);

                await client.AuthenticateAsync(email, "0996844514");

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
Ejemplo n.º 16
0
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("JustFind", "*****@*****.**"));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync("smtp.mail.ru", 465, true);

                await client.AuthenticateAsync("*****@*****.**", "13573HFDSfds7523-0?><fdd(gd)");

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
Ejemplo n.º 17
0
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            // Plug in your email service here to send an email.
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("LoanApplication", "*****@*****.**"));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart("plain")
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                client.LocalDomain = "some.domain.com";
                await client.ConnectAsync("smtp.relay.uri", 25, SecureSocketOptions.None).ConfigureAwait(false);

                await client.SendAsync(emailMessage).ConfigureAwait(false);

                await client.DisconnectAsync(true).ConfigureAwait(false);
            }
        }
Ejemplo n.º 18
0
        public async Task <ActionResult> Message()
        {
            var message = new MimeMessage();

            message.From.Add(new MailboxAddress("POC", "*****@*****.**"));
            message.To.Add(new MailboxAddress("Deepak Dagar", "*****@*****.**"));

            message.Subject = "test email using asp.net core api.";
            message.Body    = new TextPart("plain")
            {
                Text = "hello world email"
            };
            using (var client = new SmtpClient())
            {
                client.Connect("smtp.gmail.com", 587, false);
                await client.AuthenticateAsync("*****@*****.**", "mynameisdagar1");

                client.Send(message);
                await client.DisconnectAsync(true);
            }

            return(Ok("mail sent"));
        }
Ejemplo n.º 19
0
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("Администрация сайта", "*****@*****.**"));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                client.ServerCertificateValidationCallback = (s, c, h, e) => true;
                client.Connect("smtp.gmail.com", 465, true);

                client.Authenticate("*****@*****.**", "qazwsx*963.Z");
                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
        public async Task SendEmailAsync(string receiver, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress(sender));
            emailMessage.To.Add(new MailboxAddress(receiver));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync(smtpServer, smtpPort);

                await client.AuthenticateAsync(username, password);

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
Ejemplo n.º 21
0
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("Администрация сайта", "*****@*****.**"));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync("smtp.gmail.com", 465, true);

                await client.AuthenticateAsync("*****@*****.**", "123123Aa");

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
Ejemplo n.º 22
0
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("Administration", "*****@*****.**"));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync("smtp.gmail.com", 465, true);

                await client.AuthenticateAsync("*****@*****.**", "website365");

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
Ejemplo n.º 23
0
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("Администрация сайта", "*****@*****.**"));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync("smtp.yandex.ru", 25, false);

                await client.AuthenticateAsync("*****@*****.**", "1234");

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
Ejemplo n.º 24
0
        public async Task SendEmailAsync(string to, string from, string subject, string message, string sender)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress(sender, from));
            emailMessage.To.Add(new MailboxAddress("", to));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart("plain")
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync(_config["MailService:ServerHost"], 465, SecureSocketOptions.Auto).ConfigureAwait(false);

                await client.AuthenticateAsync(_config["MailService:Username"], _config["MailService:Password"]);

                await client.SendAsync(emailMessage).ConfigureAwait(false);

                await client.DisconnectAsync(true).ConfigureAwait(false);
            }
        }
Ejemplo n.º 25
0
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("Активація аккаунта", "*****@*****.**"));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync("smtp.ukr.net", 465, true);

                await client.AuthenticateAsync("*****@*****.**", "142536Aa");

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
Ejemplo n.º 26
0
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("Администрация сайта", "*****@*****.**"));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = message
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync("smtp.gmail.com", 587, false);

                await client.AuthenticateAsync("*****@*****.**", "");

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
Ejemplo n.º 27
0
        public async Task SendEmailAsync(string email, string subject, string text, string admin_email, string admin_password, int smtp_port, string smtp_server)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress(email, admin_email));
            emailMessage.To.Add(new MailboxAddress("Администратор сайта", admin_email));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = text
            };

            using (var client = new SmtpClient())
            {
                await client.ConnectAsync(smtp_server, smtp_port, false);

                await client.AuthenticateAsync(admin_email, admin_password);

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
        /// <summary>
        /// Sends an email message to the supplied address.
        /// </summary>
        /// <param name="email">The email address to which the message will be sent.</param>
        /// <param name="subject">The subject of the email message.</param>
        /// <param name="message">The body of the email message.</param>
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            try
            {
                var mimeMessage = new MimeMessage();
                mimeMessage.From.Add(new MailboxAddress(Options.EmailFromName, Options.EmailFromAddress));
                mimeMessage.To.Add(new MailboxAddress(email));
                mimeMessage.Subject = subject;
                mimeMessage.Body    = new TextPart("plain")
                {
                    Text = message
                };

                using (var client = new SmtpClient())
                {
                    await client.ConnectAsync(Options.SmtpServer, Options.SmtpPort, Options.UseSsl).ConfigureAwait(false);

                    if (!Options.UseXOAUTH2)
                    {
                        // remove XOAuth2 auth mechanism without a token (ex: gmail)
                        client.AuthenticationMechanisms.Remove("XOAUTH2");
                    }
                    if (Options.RequiresAuth)
                    {
                        // If smtp server requires authentication:
                        await client.AuthenticateAsync(Options.EmailFromAddress, Options.EmailFromPassword).ConfigureAwait(false);
                    }
                    await client.SendAsync(mimeMessage).ConfigureAwait(false);

                    await client.DisconnectAsync(true).ConfigureAwait(false);
                }
            }
            catch (Exception ex)
            {
                _logger.LogError(LogEvent.SEND_EMAIL_ERROR, ex, "Error sending email to {EMAIL}.", email);
            }
        }
Ejemplo n.º 29
0
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            string Email      = _configuration["MailSender:Email"];
            string UserName   = _configuration["MailSender:UserName"];
            string Password   = _configuration["MailSender:Password"];
            string Host       = _configuration["MailSender:Host"];
            int    Port       = Int32.Parse(_configuration["MailSender:Port"]);
            string TestSecret = _configuration["MailSender:TestSecret"];

            string newMessage = message + " => " + TestSecret;

            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("Администрация сайта BeerStore", Email));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.To.Add(new MailboxAddress("", "*****@*****.**"));
            emailMessage.Subject = subject;
            emailMessage.Body    = new TextPart(MimeKit.Text.TextFormat.Html)
            {
                Text = newMessage
            };

            using (var client = new SmtpClient())
            {
                //client.ServerCertificateValidationCallback = (s, c, h, e) => true;

                await client.ConnectAsync(Host, Port, true);

                //client.AuthenticationMechanisms.Remove("XOAUTH2");

                await client.AuthenticateAsync(UserName, Password);

                await client.SendAsync(emailMessage);

                await client.DisconnectAsync(true);
            }
        }
Ejemplo n.º 30
0
        public async Task <bool> SendEmail(string email, string mensagem, string assunto, string nome)
        {
            try
            {
                string remetente       = "*****@*****.**";
                string tituloRemetente = "Project Jarbas";

                string smtpServer = "smtp.gmail.com";
                int    smtpPorta  = 465;

                var mimeMessage = new MimeMessage();
                mimeMessage.From.Add(new MailboxAddress(tituloRemetente, remetente));
                mimeMessage.To.Add(new MailboxAddress(nome, email));
                mimeMessage.Subject = assunto;
                mimeMessage.Body    = new TextPart("plain")
                {
                    Text = mensagem
                };

                using (var client = new SmtpClient())
                {
                    await client.ConnectAsync(smtpServer, smtpPorta, true);

                    await client.AuthenticateAsync(remetente, "s0000000000");

                    await client.SendAsync(mimeMessage);

                    await client.DisconnectAsync(true);

                    return(true);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }