コード例 #1
0
 private void SetPublicProfile(int cmid, string name, MemberAccessLevel accesLevel, bool isChatDisabled, string groupTag, DateTime lastLoginDate, EmailAddressStatus emailAddressStatus, string facebookId)
 {
     Cmid               = cmid;
     Name               = name;
     AccessLevel        = accesLevel;
     IsChatDisabled     = isChatDisabled;
     GroupTag           = groupTag;
     LastLoginDate      = lastLoginDate;
     EmailAddressStatus = emailAddressStatus;
     FacebookId         = facebookId;
 }
コード例 #2
0
        public static EmailAddressStatus CheckMailAddressValid(string emailAddress, IPAddress dnsServerAddress, out string message)
        {
            EmailAddressStatus result = EmailAddressStatus.Unkown;

            message = string.Empty;

            if (emailValidRegex.IsMatch(emailAddress))
            {
                MXRecord[] records = DNSResolver.MXLookup(emailAddress.Substring(emailAddress.IndexOf("@") + 1), dnsServerAddress);

                if (records != null && records.Length > 0)
                {
                    foreach (MXRecord record in records)
                    {
                        Socket socket = null;
                        try
                        {
                            IPEndPoint remoteEP = new IPEndPoint(Dns.GetHostEntry(record.DomainName).AddressList[0], 25);
                            socket = new Socket(remoteEP.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
                            socket.Connect(remoteEP);

                            message = Get_Response(socket);
                            if (GetResponseCode(message) == 220)
                            {
                                SendData(socket, "HELO {0}\r\n".FormatWith(record.DomainName));
                                message = Get_Response(socket);
                                if (GetResponseCode(message) == 250)
                                {
                                    SendData(socket, "MAIL FROM:<{0}>\r\n".FormatWith("*****@*****.**"));
                                    message = Get_Response(socket);
                                    if (GetResponseCode(message) == 250)
                                    {
                                        SendData(socket, "RCPT TO:<{0}>\r\n".FormatWith(emailAddress));
                                        message = Get_Response(socket);
                                        if (GetResponseCode(message) == 250)
                                        {
                                            return(EmailAddressStatus.Valid);
                                        }
                                        if (message.IndexOf("denied") > 0)
                                        {
                                            SendData(socket, "QUIT\r\n");
                                            socket.Close();
                                            return(EmailAddressStatus.DenyAccess);
                                        }
                                        return(EmailAddressStatus.AccountNotExists);
                                    }
                                }
                            }
                        }
                        catch (TimeoutException)
                        {
                            result = EmailAddressStatus.Timeout;
                        }
                        catch (Exception e)
                        {
                            message = e.Message;
                        }
                        finally
                        {
                            if (socket != null && socket.Connected)
                            {
                                socket.Close();
                            }
                        }
                    }
                }
                else
                {
                    result = EmailAddressStatus.InvalidDomain;
                }
            }
            else
            {
                result = EmailAddressStatus.InvalidEmailFormat;
            }

            return(result);
        }
コード例 #3
0
 // Token: 0x0600035A RID: 858 RVA: 0x0000E6B4 File Offset: 0x0000C8B4
 public PublicProfileView(int cmid, string name, MemberAccessLevel accesLevel, bool isChatDisabled, string groupTag, DateTime lastLoginDate, EmailAddressStatus emailAddressStatus, string facebookId)
 {
     this.SetPublicProfile(cmid, name, accesLevel, isChatDisabled, groupTag, lastLoginDate, emailAddressStatus, facebookId);
 }