Ejemplo n.º 1
0
        public void Send_Null()
        {
            EmailModel email = new EmailModel();

            email.To = null;
            email.Subject = null;
            email.Message = "*****@*****.**";
            email.DeliveryType = "Email";

            con.SendEmail(email);
        }
Ejemplo n.º 2
0
        public void Send_StringEmpty()
        {
            EmailModel email = new EmailModel();

            email.To = string.Empty;
            email.Subject = string.Empty;
            email.Message = "*****@*****.**";
            email.DeliveryType = "Email";

            con.SendEmail(email);
        }
Ejemplo n.º 3
0
        public void Send_DeliveryTypeCheckNotEmail()
        {
            EmailModel email = new EmailModel();

            email.To = "*****@*****.**";
            email.Subject = "Test";
            email.Message = "*****@*****.**";
            email.DeliveryType = "Post";

            con.SendEmail(email);
        }
Ejemplo n.º 4
0
        public void Send_InvalidEmailAddressException()
        {
            EmailModel email = new EmailModel();

            email.To = "sdfsdfsdf";
            email.Subject = "sdfsdf";
            email.Message = "*****@*****.**";
            email.DeliveryType = "Email";

            con.SendEmail(email);
        }
Ejemplo n.º 5
0
        public void SendGrid_Send()
        {
            EmailModel email = new EmailModel();

            email.To = "*****@*****.**";
            email.Subject = "sdfsdf";
            email.Message = "*****@*****.**";
            email.DeliveryType = "Email";

            EmailEngine execute = new EmailEngine(email);
            execute.Send();
        }
Ejemplo n.º 6
0
        public void Submit(EmailModel email)
        {
            if (string.IsNullOrEmpty(email.To) || string.IsNullOrEmpty(email.Subject))
            {
                throw new Exception("Data is not correct");
            }

            MailAddress mail = new MailAddress(email.To);

            if (email.DeliveryType != "Email")
            {
                throw new Exception("Delivery Type not set to type,  Email.");
            }
        }
Ejemplo n.º 7
0
        public HttpResponseMessage SendEmail(EmailModel email)
        {
            if (string.IsNullOrEmpty(email.To) || string.IsNullOrEmpty(email.Subject))
            {
                throw new Exception("Data is not correct");
            }

            MailAddress mail = new MailAddress(email.To);

            if (email.DeliveryType != "Email")
            {
                throw new Exception("Delivery Type not set to type,  Email.");
            }

            return base.Request.CreateResponse(HttpStatusCode.OK);
        }
Ejemplo n.º 8
0
        public void Send_ValidEmailAddressTo()
        {
            EmailModel email = new EmailModel();

            email.To = "*****@*****.**";
            email.Subject = "sdfsdf";
            email.Message = "*****@*****.**";
            email.DeliveryType = "Email";

            con.SendEmail(email);
        }
Ejemplo n.º 9
0
 public EmailEngine(EmailModel email)
 {
 }