示例#1
0
        public object applyOn(SpotterJson spotter)
        {
            var root = spotter.GetRoot();
            var mail = new MailMsg();

            if (root.XPathSelectElement("/result/message") != null)
            {
                // there should be only one message in response to display message
                foreach (var msg in root.XPathSelectElements("/result/message/item"))
                {
                    mail.Subject      = msg.XPathSelectElement("header/subject").Value;
                    mail.From         = msg.XPathSelectElement("header/from/email").Value;
                    mail.To           = YahooGetListedMessages.GetAllInArray(msg, "header/to//email", "; ");
                    mail.Cc           = YahooGetListedMessages.GetAllInArray(msg, "header/cc//email", "; ");
                    mail.Bcc          = YahooGetListedMessages.GetAllInArray(msg, "header/bcc//email", "; ");
                    mail.Body         = YahooGetListedMessages.GetAllInArray(msg, "part//text", "");
                    mail.SourceFolder = msg.XPathSelectElement("sourceFolderInfo/name").Value;
                }
            }

            return(mail);
        }