public override Email readEmail(string email, string password, string proxyAddress, string proxyPort, string proxyUser, string proxyPassword, string DOB, ref GlobusHttpHelper HttpHelper, string registrationstatus) { //throw new NotImplementedException();//Ajay to code this part Email objEmail = new Email(); string yahooEmail = string.Empty; string yahooPassword = string.Empty; string Username = string.Empty; string Password = string.Empty; try { objEmail.username = email; objEmail.password = password; string realEmail = email; yahooEmail = email; ; yahooPassword = password; Chilkat.Imap iMap = new Imap(); // Code For [email protected] if (yahooEmail.Contains("+") || yahooEmail.Contains("%2B")) { try { string replacePart = yahooEmail.Substring(yahooEmail.IndexOf("+"), (yahooEmail.IndexOf("@", yahooEmail.IndexOf("+")) - yahooEmail.IndexOf("+"))).Replace("+", string.Empty); yahooEmail = yahooEmail.Replace("+", string.Empty).Replace("%2B", string.Empty).Replace(replacePart, string.Empty); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } Username = yahooEmail; Password = yahooPassword; //Username = "******"; //Password = "******"; iMap.UnlockComponent("THEBACIMAPMAILQ_OtWKOHoF1R0Q"); //iMap. //iMap.HttpProxyHostname = "127.0.0.1"; //iMap.HttpProxyPort = 8888; iMap.Connect("imap.n.mail.yahoo.com"); iMap.Login(yahooEmail, yahooPassword); iMap.SelectMailbox("Inbox"); // Get a message set containing all the message IDs // in the selected mailbox. Chilkat.MessageSet msgSet; //msgSet = iMap.Search("FROM \"facebookmail.com\"", true); msgSet = iMap.GetAllUids(); // Fetch all the mail into a bundle object. Chilkat.Email cEemail = new Chilkat.Email(); //bundle = iMap.FetchBundle(msgSet); string strEmail = string.Empty; List<string> lstData = new List<string>(); if (msgSet != null) { for (int i = msgSet.Count; i > 0; i--) { cEemail = iMap.FetchSingle(msgSet.GetId(i), true); strEmail = cEemail.Subject; string emailHtml = cEemail.GetHtmlBody(); lstData.Add(strEmail); if (cEemail.Subject.Contains("Action Required: Confirm Your Facebook Account")) { foreach (string href in GetUrlsFromString(cEemail.Body)) { try { string staticUrl = string.Empty; string email_open_log_picUrl = string.Empty; string strBody = cEemail.Body; string[] arr = Regex.Split(strBody, "src="); // string[] arr = Regex.Split(strBody, "href="); foreach (string item in arr) { if (!item.Contains("<!DOCTYPE")) { if (item.Contains("static")) { string[] arrStatic = item.Split('"'); staticUrl = arrStatic[1]; } if (item.Contains("email_open_log_pic")) { string[] arrlog_pic = item.Split('"'); email_open_log_picUrl = arrlog_pic[1]; email_open_log_picUrl = email_open_log_picUrl.Replace("amp;", ""); break; } } } string href1 = href.Replace("&report=1", ""); href1 = href.Replace("amp;", ""); objEmail.body = strBody; objEmail.subject = cEemail.Subject; objEmail.to = cEemail.ReplyTo; objEmail.from = cEemail.From.ToString(); objEmail.mailType = MailType.yahoomail; EmailVerificationMultithreadedForAccountCreater(href1, staticUrl, email_open_log_picUrl, realEmail, yahooPassword, proxyAddress, proxyPort, proxyUser, proxyPassword); //LoginVerfy(href1, staticUrl, email_open_log_picUrl); break; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } } //return; } else if (cEemail.Subject.Contains("Just one more step to get started on Facebook")) { foreach (string href in GetUrlsFromString(cEemail.Body)) { try { string staticUrl = string.Empty; string email_open_log_picUrl = string.Empty; string verifyhref = string.Empty; string strBody = cEemail.Body; string[] arr = Regex.Split(strBody, "src="); string[] arr1 = Regex.Split(strBody, "href="); foreach (string item in arr) { if (!item.Contains("<!DOCTYPE")) { if (item.Contains("static")) { string[] arrStatic = item.Split('"'); staticUrl = arrStatic[1]; } if (item.Contains("email_open_log_pic")) { string[] arrlog_pic = item.Split('"'); email_open_log_picUrl = arrlog_pic[1]; email_open_log_picUrl = email_open_log_picUrl.Replace("amp;", ""); break; } } } foreach (string item1 in arr1) { if (item1.Contains("confirmemail.php")) { string[] itemurl = Regex.Split(item1, "\""); verifyhref = itemurl[1].Replace("\"", string.Empty); } } string href1 = verifyhref.Replace("&report=1", ""); string href11 = href1.Replace("amp;", ""); objEmail.body = strBody; objEmail.subject = cEemail.Subject; objEmail.to = cEemail.ReplyTo; objEmail.from = cEemail.From.ToString(); objEmail.mailType = MailType.yahoomail; //string href1 = href.Replace("&report=1", ""); //href1 = href.Replace("amp;", ""); if (href.Contains("confirmemail.php") && email_open_log_picUrl.Contains("email_open_log_pic.php")) { EmailVerificationMultithreadedForAccountCreater(href11, staticUrl, email_open_log_picUrl, realEmail, yahooPassword, proxyAddress, proxyPort, proxyUser, proxyPassword); //LoginVerfy(href1, staticUrl, email_open_log_picUrl); break; } } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } //return; } //*****************************************************bysanjeev********************** else if (cEemail.Subject.Contains("Facebook Email Verification")) { foreach (string href in GetUrlsFromString(cEemail.Body)) { try { string staticUrl = string.Empty; string email_open_log_picUrl = string.Empty; string verifyhref = string.Empty; string strBody = cEemail.Body; string[] arr = Regex.Split(strBody, "src="); string[] arr1 = Regex.Split(strBody, "href="); // string[] arr = Regex.Split(strBody, "src="); foreach (string item in arr) { if (!item.Contains("<!DOCTYPE")) { if (item.Contains("static")) { string[] arrStatic = item.Split('"'); staticUrl = arrStatic[1]; } if (item.Contains("email_open_log_pic")) { string[] arrlog_pic = item.Split('"'); email_open_log_picUrl = arrlog_pic[1]; email_open_log_picUrl = email_open_log_picUrl.Replace("amp;", ""); break; } } } foreach (string item1 in arr1) { if (item1.Contains("confirmcontact.php")) { string[] itemurl = Regex.Split(item1, "\""); verifyhref = itemurl[1].Replace("\"", string.Empty); } } //string href1 = href.Replace("&report=1", ""); //href1 = href.Replace("&", ""); objEmail.body = strBody; objEmail.subject = cEemail.Subject; objEmail.to = cEemail.ReplyTo; objEmail.from = cEemail.From.ToString(); objEmail.mailType = MailType.yahoomail; if (href.Contains("confirmcontact.php") && email_open_log_picUrl.Contains("email_open_log_pic.php")) { EmailVerificationMultithreadedForAccountCreater(verifyhref, staticUrl, email_open_log_picUrl, realEmail, yahooPassword, proxyAddress, proxyPort, proxyUser, proxyPassword); break; }//LoginVerfy(href1, staticUrl, email_open_log_picUrl); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } //return; } //**************************************************************************************** } } } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } return objEmail; }
public override Email createEmail(ref WebBrowser wbrwsr,string Captcha ,List<string> FirstName,List<string> LastName) { Email objemail = new Email(); try { // throw new NotImplementedException(); //Amit to code this part this.webHotmail = wbrwsr; FirstNameList = FirstName; LastNameList = LastName; _Recapctha = Captcha; FillValuesInWebBrowserPage(); Thread.Sleep(4000); objemail.username = mName + "@hotmail.com"; objemail.password = sPassword; } catch { }; return objemail; }
public override Email readEmail(string email, string password, string proxyAddress, string proxyPort, string proxyUser, string proxyPassword, string DOB, ref GlobusHttpHelper HttpHelper, string registrationstatus) { //throw new NotImplementedException();//Ajay to code this part Email objEmail = new Email(); string realEmail = string.Empty; try { objEmail.username = email; objEmail.password = password; realEmail = email; POPClient popClient = new POPClient(); #region Hotmail if (email.Contains("@hotmail")) { try { // Code For [email protected] if (email.Contains("+") || email.Contains("%2B")) { try { string replacePart = email.Substring(email.IndexOf("+"), (email.IndexOf("@", email.IndexOf("+")) - email.IndexOf("+"))).Replace("+", string.Empty); email = email.Replace("+", string.Empty).Replace("%2B", string.Empty).Replace(replacePart, string.Empty); } catch(Exception ex) { GlobusLogHelper.log.Error("Error : "+ex.StackTrace); } } if (popClient.Connected) popClient.Disconnect(); popClient.Connect("pop3.live.com", int.Parse("995"), true); //live popClient.Authenticate(email, password); int Count = popClient.GetMessageCount(); for (int i = Count; i >= 1; i--) { try { OpenPOP.MIME.Message Message = popClient.GetMessage(i); string subject = Message.Headers.Subject; if (Message.Headers.Subject.Contains("Action Required: Confirm Your Facebook Account")) { foreach (string href in GetUrlsFromString(Message.MessageBody[0])) { try { string staticUrl = string.Empty; string email_open_log_picUrl = string.Empty; string strBody = Message.MessageBody[0]; string[] arr = Regex.Split(strBody, "src="); foreach (string item in arr) { if (!item.Contains("<!DOCTYPE")) { if (item.Contains("static")) { string[] arrStatic = item.Split('"'); staticUrl = arrStatic[1]; } if (item.Contains("email_open_log_pic")) { try { string[] arrlog_pic = item.Split('"'); email_open_log_picUrl = arrlog_pic[1]; email_open_log_picUrl = email_open_log_picUrl.Replace("amp;", ""); } catch(Exception ex) { GlobusLogHelper.log.Error("Error :"+ex.StackTrace); } break; } } } string href1 = href.Replace("&report=1", ""); href1 = href.Replace("amp;", ""); objEmail.body = strBody; objEmail.subject = Message.Headers.Subject; List<System.Net.Mail.MailAddress> lstTo = Message.Headers.To; foreach (System.Net.Mail.MailAddress item in lstTo) { try { objEmail.to = objEmail.to + item.ToString(); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } objEmail.from = Message.Headers.From.ToString(); objEmail.mailType = MailType.hotmail; // if (href1.Contains(Uri.EscapeDataString(realEmail))) { EmailVerificationMultithreaded(href1, staticUrl, email_open_log_picUrl, realEmail, password, proxyAddress, proxyPort, proxyUser, proxyPassword, ref HttpHelper); } } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } } else if (Message.Headers.Subject.Contains("Just one more step to get started on Facebook")) { foreach (string href in GetUrlsFromString(Message.MessageBody[0])) { try { string staticUrl = string.Empty; string email_open_log_picUrl = string.Empty; string strBody = Message.MessageBody[0]; string[] arr = Regex.Split(strBody, "src="); foreach (string item in arr) { try { if (!item.Contains("<!DOCTYPE")) { if (item.Contains("static")) { string[] arrStatic = item.Split('"'); staticUrl = arrStatic[1]; } if (item.Contains("email_open_log_pic")) { string[] arrlog_pic = item.Split('"'); email_open_log_picUrl = arrlog_pic[1]; email_open_log_picUrl = email_open_log_picUrl.Replace("amp;", ""); break; } } } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } string href1 = href.Replace("&report=1", ""); href1 = href.Replace("amp;", ""); objEmail.body = strBody; objEmail.subject = Message.Headers.Subject; List<System.Net.Mail.MailAddress> lstTo = Message.Headers.To; foreach (System.Net.Mail.MailAddress item in lstTo) { try { objEmail.to = objEmail.to + item.ToString(); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } objEmail.from = Message.Headers.From.ToString(); objEmail.mailType = MailType.hotmail; // if (href1.Contains(Uri.EscapeDataString(realEmail))) { EmailVerificationMultithreaded(href1, staticUrl, email_open_log_picUrl, realEmail, password, proxyAddress, proxyPort, proxyUser, proxyPassword, ref HttpHelper); } } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } } } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } #endregion } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } return objEmail; }
/// <summary> /// This method is used for check Page status for new Acouunts created or not, after Page Document Completed /// </summary> public void CheckStatus() { try { bool Captchastatus = true; Email objemail = new Email(); if (webHotmail.ReadyState == WebBrowserReadyState.Complete) { if (webHotmail.Document.Body.OuterHtml.Contains("Sign out") || webHotmail.Document.Body.OuterHtml.Contains("sign out")) { try { objemail.username = Username; objemail.password = Password; DataSet ds = new DataSet(); Captchastatus = false; GlobusLogHelper.log.Info("EmaillAccount : Username : "******" Password : "******" has Created"); RaiseEvent(ds, new string[] { "Model : EmailRepository", "Function : InsertCreatedEmailinEmailDatatbase", Username, Password }); hotmailerStatus = HotmailerStatus.LoggedOut; //EmailAccountDataPath string CSVHeader = "Username"+","+"Password"; string CSV_Content = Username+","+Password; try { Globussoft.GlobusFileHelper.ExportDataCSVFile(CSVHeader, CSV_Content, EmailAccountDataPath); GlobusLogHelper.log.Debug("Data Saved In CSV ." + CSV_Content); GlobusLogHelper.log.Info("Data Saved In CSV ." + CSV_Content); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } Thread.Sleep(2000); this.Hide(); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } if (webHotmail.Document.Body.OuterHtml.Contains("<BODY onload=javascript:rd();></BODY>") && webHotmail.Document.Body.OuterHtml.Count() < 200) { try { objemail.username = Username; objemail.password = Password; DataSet ds = new DataSet(); Captchastatus = false; GlobusLogHelper.log.Info("EmaillAccount : Username : "******" Password : "******" has Created"); RaiseEvent(ds, new string[] { "Model : EmailRepository", "Function : InsertCreatedEmailinEmailDatatbase", Username, Password }); hotmailerStatus = HotmailerStatus.LoggedOut; Thread.Sleep(2000); this.Hide(); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } if (webHotmail.Document.Body.OuterHtml.Contains("<BODY></BODY>") && webHotmail.Document.Body.OuterHtml.Count() < 100) { try { objemail.username = Username; objemail.password = Password; DataSet ds = new DataSet(); Captchastatus = false; GlobusLogHelper.log.Info("EmaillAccount : Username : "******" Password : "******" has Created"); RaiseEvent(ds, new string[] { "Model : EmailRepository", "Function : InsertCreatedEmailinEmailDatatbase", Username, Password }); hotmailerStatus = HotmailerStatus.LoggedOut; Thread.Sleep(2000); this.Hide(); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } if (webHotmail.Document.Body.OuterHtml.Contains("Sign Up Error 450")) { try { GlobusLogHelper.log.Error("Error : " + "Error 450 Track IP address"); hotmailerStatus = HotmailerStatus.LoggedOut; Thread.Sleep(2000); this.Hide(); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } if (webHotmail.Document.Body.OuterHtml.Contains("Sign out and sign in with a different account")) { try { HtmlElementCollection h1 = (HtmlElementCollection)webHotmail.Document.GetElementsByTagName("A"); foreach (HtmlElement h2 in h1) { if (h2.OuterHtml.Contains("Sign out and sign in with a different account") || h2.OuterHtml.Contains("Sign out")) { h2.InvokeMember("click"); string outerhtml = h2.OuterHtml; string outerhref = outerhtml.Substring(outerhtml.IndexOf("href="), outerhtml.IndexOf("\">") - outerhtml.IndexOf("href=")).Replace("href=", "").Replace("\"", "").Trim(); webHotmail.Navigate(outerhref); break; } } } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } if (webHotmail.Document.Body.OuterHtml.Contains("The characters didn't match the picture. Please try again.") && Captchastatus == true) { try { FindCaptcha(); hotmailerStatus = HotmailerStatus.None; Thread.Sleep(2000); this.Hide(); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } } } } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } }