public static bool SendMail(EmailModel mailModel)
        {
            try
            {
                MailMessage mail = new MailMessage("*****@*****.**", mailModel.ToEmail);
                SmtpClient client = new SmtpClient();
                client.Port = 26;
                client.DeliveryMethod = SmtpDeliveryMethod.Network;
                client.UseDefaultCredentials = false;
                client.Host = "mail.doerit.com";
                client.EnableSsl = false;
                client.Credentials = new System.Net.NetworkCredential("*****@*****.**", "1qaz2wsx@");
                mail.Subject = mailModel.Subject;
                mail.Body = mailModel.Body;

                if (mailModel.AttachmentPath != null && mailModel.AttachmentPath != "")
                {
                    Attachment attachment = new System.Net.Mail.Attachment(mailModel.AttachmentPath);
                    mail.Attachments.Add(attachment);
                }

                client.Send(mail);

                return true;
            }
            catch (Exception)
            {
                return false;
            }            
        }
 private async void SendButton_Click(object sender, RoutedEventArgs e)
 {
     createEmail();
     if (EMAIL != null)
     {
         bool result = EmailHandler.SendMail(EMAIL);
         if (result)
         {
             await MainWindow.Instance.ShowMessageAsync(Messages.TTL_MSG, "Email has been sent", MessageDialogStyle.Affirmative);
             EMAIL = null;
         }
         else
         {
             await MainWindow.Instance.ShowMessageAsync(Messages.TTL_MSG, "Email sending failed", MessageDialogStyle.Affirmative);
         }
     }
     else
     {
         await MainWindow.Instance.ShowMessageAsync(Messages.TTL_MSG, "Please Enter Valied Email!", MessageDialogStyle.Affirmative);
     }
 }
        private void createEmail()
        {
            EmailModel email = new EmailModel();

            try
            {
                if(EmailHandler.IsValidEmail(EmailAddressTextBox.Text))
                {
                    email.ToEmail = EmailAddressTextBox.Text;
                    email.Subject = EmailSubjectTextBox.Text;
                    email.Body = EmailContentTextBox.Text;
                    email.AttachmentPath = AttachmentPathLabel.Content.ToString();

                    EMAIL = email;
                }
                else 
                {
                    EMAIL = email;
                }

            }
            catch
            {
                EMAIL = null;
            }
        }