Advertisement
Guest User

Untitled

a guest
Jun 5th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.88 KB | None | 0 0
  1. private void verify()
  2.         {
  3.             Chilkat.MailMan mailman = new Chilkat.MailMan();
  4.             mailman.UnlockComponent("ZIP!TEAM!BEAN_009307E59RoC");
  5.             mailman.MailHost = "pop.gmail.com";
  6.             mailman.PopUsername = "kinganu123@gmail.com";
  7.             mailman.PopPassword = "blehblah";
  8.             mailman.PopSsl = true;
  9.             mailman.MailPort = 995;
  10.             Chilkat.EmailBundle bundle = default(Chilkat.EmailBundle);
  11.             MessageBox.Show("Hit 1");
  12.             bundle = mailman.CopyMail();
  13.             if (bundle == null == false)
  14.             {
  15.                 int i = 0;
  16.                 int n = bundle.MessageCount;
  17.                 MessageBox.Show("Hit 2");
  18.                 for (i = 0; i <= n - 1; i++)
  19.                 {
  20.                     Chilkat.Email email = bundle.GetEmail(i);
  21.                     string body = "Grockit offers your child 3 engaging ways to learn:";
  22.                     body = email.Body;
  23.                     System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("<a href=\\\"([^\\\"]*)\\\">(.*?)<\\/a>", System.Text.RegularExpressions.RegexOptions.IgnoreCase | System.Text.RegularExpressions.RegexOptions.Compiled | System.Text.RegularExpressions.RegexOptions.Singleline);
  24.                     System.Text.RegularExpressions.MatchCollection col = regex.Matches(body);
  25.                     foreach (System.Text.RegularExpressions.Match match in col)
  26.                     {
  27.                         string link = match.Groups[1].Value;
  28.                         if (link.Contains("grockit.com"))
  29.                         {
  30.                             MessageBox.Show(link);
  31.                         }
  32.                         else
  33.                         {
  34.                             MessageBox.Show("error");
  35.                         }
  36.                     }
  37.                 }
  38.             }
  39.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement