예제 #1
0
 public static void Send(MailEntity entity, MailSendType type = MailSendType.Smtp)
 {
     MailWrapper wrapper;
     if (!s_Cache.TryGetValue(type, out wrapper))
     {
         lock (s_SyncObj)
         {
             if (!s_Cache.TryGetValue(type, out wrapper))
             {
                 XmlNode section = ConfigurationManager.GetSection("mail") as XmlNode;
                 wrapper = new MailWrapper(section, type);
                 s_Cache.Add(type, wrapper);
             }
         }
     }
     wrapper.Send(entity);
 }
예제 #2
0
        public static void Send(MailEntity entity, MailSendType type = MailSendType.Smtp)
        {
            MailWrapper wrapper;

            if (!s_Cache.TryGetValue(type, out wrapper))
            {
                lock (s_SyncObj)
                {
                    if (!s_Cache.TryGetValue(type, out wrapper))
                    {
                        XmlNode section = ConfigurationManager.GetSection("mail") as XmlNode;
                        wrapper = new MailWrapper(section, type);
                        s_Cache.Add(type, wrapper);
                    }
                }
            }
            wrapper.Send(entity);
        }