private MailAddressCollection LoadTo() { foreach (Field field in m_Fields) { if (field.Name != null) { if (field.Name.ToLower().Equals("to")) { IFieldParserProxy parser = FieldParserProxy.Getinstance(); if (parser.AddrSpec.IsMatch(field.Body)) { MailAddressCollection addresses = new MailAddressCollection(); MatchCollection matches = parser.AddrSpec.Matches(field.Body); foreach (Match match in matches) { addresses.Add(match.Value); } return(addresses); } } } } return(null); }
private MailAddressCollection LoadAdressCollection(string fieldBody) { IFieldParserProxy parser = jingxian.mail.mime.FieldParserProxy.Getinstance(); if (parser.AddrSpec.IsMatch(fieldBody)) { MailAddressCollection addresses = new MailAddressCollection(); try { addresses.Add(fieldBody); } catch (FormatException) { MatchCollection matches = parser.AddrSpec.Matches(fieldBody); foreach (Match match in matches) { addresses.Add(match.Value); } } return(addresses); } return(null); }
public MailReader() { m_Decoders = new List <RFC2045.IDecoder>(); m_Decoders.Add(new QuotedPrintableDecoder()); m_Decoders.Add(new Base64Decoder()); m_FieldParser = FieldParserProxy.Getinstance(); m_FieldParser.CompilePattern(); }
public static IFieldParserProxy Getinstance() { if (s_Proxy == null) { s_Proxy = new FieldParserProxy(); } return(s_Proxy); }
public static string ParseAddress(string data) { IFieldParserProxy proxy = Getinstance(); if (proxy.AddrSpec.IsMatch(data)) { return(proxy.AddrSpec.Match(data).Value); } else { return(string.Empty); } }
public MailReader(IList <IDecoder> decoders, IFieldParserProxy proxy) : this(decoders) { m_FieldParser = proxy; m_FieldParser.CompilePattern(); }
public static void ParseFields(ref IList <RFC822.Field> fields, ref string fieldString) { IFieldParserProxy proxy = Getinstance(); proxy.Parse(ref fields, ref fieldString); }