示例#1
0
        public static IEmail ReadEmailFromFilePath(string path)
        {
            Assert.IsTrue(File.Exists(path));
            string emailText = File.ReadAllText(path);

            SMTPMessage msg = new SMTPMessage();
            msg.AddData(emailText);

            SmtpEmail email = new SmtpEmail(msg);

            return email;
        }
示例#2
0
        public bool SpoolMessage(SMTPMessage message)
        {
            ServiceLocator.Current.Log.Information("Email encountered");

            try
            {
                GvEmailHandler handler = new GvEmailHandler();
                SmtpEmail email = new SmtpEmail(message);
                handler.HandleEmail(email);
            }
            catch (Exception ex)
            {
                // We can survive an Exception, since it only breaks this message's processing. Continue to strive for others.
                ServiceLocator.Current.Log.Warning("Exception in MessageSpool! " + ex.Message);
            }

            return true;
        }