Example #1
0
        private void GMaiLTheResults(string _Body, string[] Addressees, string _Subject = "Results from testing")
        {
            var fromAddress = new MailAddress(fromEmailAddress, "Automated Testing");
            var toAddress   = new MailAddress("*****@*****.**", "EmailerAuthor");

            SASS s = new SASS();

            fromPassword = s.DecryptString(fromPassword);

            var smtp = new SmtpClient
            {
                Host                  = "smtp.gmail.com",
                Port                  = 587,
                EnableSsl             = true,
                DeliveryMethod        = SmtpDeliveryMethod.Network,
                UseDefaultCredentials = false,
                Credentials           = new NetworkCredential(fromEmailAddress, fromPassword)
            };
            var message = new MailMessage(fromAddress, toAddress);

            message.Subject = _Subject;
            message.Body    = _Body;

            if (Addressees.Count() >= 1)
            {
                foreach (var i in Addressees)
                {
                    message.To.Add(i);
                }
            }
            smtp.Send(message);
        }
Example #2
0
        public Emailer(string _FromEmailAddress = "", string _AccountCred = "")
        {
            SASS s = new SASS();

            fromPassword     = s.EncryptToString(_AccountCred);
            fromEmailAddress = _FromEmailAddress;
        }