Exemplo n.º 1
0
        private void SendFromDatabase_Click(object sender, EventArgs e)
        {
            try
            {
                Output.Text = string.Empty;

                DatabaseReaderService databaseReaderService = new DatabaseReaderService();
                string messageBody = databaseReaderService.GetMessageBody();

                EmailSender emailSender = new EmailSender();
                emailSender.SendEmail(messageBody);

                Output.Text = "Sent email with body: " + Environment.NewLine + messageBody;
            }
            catch (Exception ex)
            {
                Output.Text = ex.ToString();
            }
        }
        private void SendFromDatabase_Click(object sender, EventArgs e)
        {
            try
            {
                Output.Text = string.Empty;

                DatabaseReaderService databaseReaderService = new DatabaseReaderService();
                string messageBody = databaseReaderService.GetMessageBody();

                EmailSender emailSender = new EmailSender();
                emailSender.SendEmail(messageBody);

                Output.Text = "Sent email with body: " + Environment.NewLine + messageBody;
            }
            catch (Exception ex)
            {
                Output.Text = ex.ToString();
            }
        }
 public void ReadDatabase()
 {
     DatabaseReaderService databaseReaderService = new DatabaseReaderService();
     MessageBody = databaseReaderService.GetMessageBody();
 }
        public void ReadDatabase()
        {
            DatabaseReaderService databaseReaderService = new DatabaseReaderService();

            MessageBody = databaseReaderService.GetMessageBody();
        }