Example #1
0
        void send_changevenue()
        {
            string msgs;
            int    mi = 0;

            if (lvList.Items.Count > 0)
            {
                foreach (ListViewItem l in lvList.Items)
                {
                    if (!l.Checked)
                    {
                        continue;
                    }

                    if (l.SubItems[3].Text.Length == 0)
                    {
                        l.SubItems[8].Text = "No email!";
                        continue;
                    }

                    msgs = (File.OpenText(Path.Combine(Program.rootfolder, @"MSGS", "changevenue.txt"))).ReadToEnd();

                    //MailMessage m = new MailMessage("*****@*****.**", l.SubItems[3].Text, "Change of venue", msgs);
                    messages[mi] = new MailMessage("*****@*****.**", l.SubItems[3].Text, "Change of venue", msgs);
                    cmailer c = new cmailer(nc);
                    c.send(messages[mi], new dummyobject(l, 3, mi));
                    mi++;
                }
            }
        }
Example #2
0
        void send_standardreply()
        {
            string msgs;

            msgs = (File.OpenText(Path.Combine(Program.rootfolder, @"MSGS", "regformtxt.txt"))).ReadToEnd();
            int mi = 0;

            if (lvList.Items.Count > 0)
            {
                foreach (ListViewItem l in lvList.Items)
                {
                    if (!l.Checked)
                    {
                        continue;
                    }

                    if (l.SubItems[3].Text.Length == 0)
                    {
                        l.SubItems[8].Text = "No email!";
                        continue;
                    }

                    //MailMessage m = new MailMessage("*****@*****.**", l.SubItems[3].Text, "Reminders about registration form", msgs);
                    messages[mi] = new MailMessage("*****@*****.**", l.SubItems[3].Text, "Reminders about registration form", msgs);
                    cmailer c = new cmailer(nc);
                    c.send(messages[mi], new dummyobject(l, 1, mi));
                    mi++;
                }
            }
        }
Example #3
0
/*		void send_standardreply()
 *              {
 *                      string msgs;
 *          msgs = (File.OpenText(Path.Combine(Program.rootfolder,@"TEMPLATE","mainreply.html"))).ReadToEnd();
 *                      int mi = 0;
 *                      if (lvList.Items.Count > 0)
 *                      {
 *                              foreach (ListViewItem l in lvList.Items)
 *                              {
 *                                      if (!l.Checked)
 *                                              continue;
 *
 *                                      if (l.SubItems[3].Text.Length == 0)
 *                                      {
 *                                              l.SubItems[8].Text = "No email!";
 *                                              continue;
 *                                      }
 *
 *                                      messages[mi] = new MailMessage(Program.userid +  "@gmail.com", l.SubItems[3].Text);
 *                  messages[mi].From = new MailAddress(Program.userid + "@gmail.com", "MTGPHIL");
 *                  messages[mi].Subject = "Reminders about registration form";
 *                  messages[mi].IsBodyHtml = true;
 *                  messages[mi].Body = msgs;
 *                  messages[mi].BodyEncoding = ASCIIEncoding.Default;
 *                                      cmailer c = new cmailer(nc);
 *                                      c.send(messages[mi], new dummyobject(l,1,mi));
 *                                      mi++;
 *                              }
 *                      }
 *              }*/

        void send_registrationform()
        {
            string msgs;
            string att_path;
            int    mi = 0;

            if (lvList.Items.Count > 0)
            {
                foreach (ListViewItem l in lvList.Items)
                {
                    if (!l.Checked)
                    {
                        continue;
                    }

                    if (l.SubItems[3].Text.Length == 0)
                    {
                        l.SubItems[8].Text = "No email!";
                        continue;
                    }

                    att_path = fetchregform(Int32.Parse(l.Tag.ToString()));

                    if (att_path.Length == 0)
                    {
                        l.SubItems[8].Text = "Registration form not found.";
                        continue;
                    }

                    msgs              = (File.OpenText(Path.Combine(Program.rootfolder, @"TEMPLATE", "confirmERF.html"))).ReadToEnd();
                    msgs              = msgs.Replace("nName", Program.getFirstName(l.Text));
                    messages[mi]      = new MailMessage(uids[Program.nc_index] + "@gmail.com", l.SubItems[3].Text, "Electronic Reply Form of " + l.Text, msgs);
                    messages[mi].From = new MailAddress(uids[Program.nc_index] + "@gmail.com", "MTGPHIL");
                    messages[mi].Attachments.Add(new Attachment(att_path));
                    messages[mi].IsBodyHtml   = true;
                    messages[mi].BodyEncoding = ASCIIEncoding.Default;
                    cmailer c = new cmailer(nc[Program.nc_index]);
                    Program.nc_index++;
                    if (Program.nc_index == uids.Length)
                    {
                        Program.nc_index = 0;
                    }
                    c.send(messages[mi], new dummyobject(l, 2, mi));
                    mi++;
                }
            }
        }
Example #4
0
        void send_modified_erf()
        {
            string msgs;
            string att_path;
            int    mi = 0;

            if (lvList.Items.Count > 0)
            {
                foreach (ListViewItem l in lvList.Items)
                {
                    if (!l.Checked)
                    {
                        continue;
                    }

                    if (l.SubItems[3].Text.Length == 0)
                    {
                        l.SubItems[8].Text = "No email!";
                        continue;
                    }

                    att_path = fetchregform(Int32.Parse(l.Tag.ToString()));

                    if (att_path.Length == 0)
                    {
                        l.SubItems[8].Text = "Registration form not found.";
                        continue;
                    }

                    msgs = (File.OpenText(Path.Combine(Program.rootfolder, @"MSGS", "modreg.txt"))).ReadToEnd();

                    //MailMessage m = new MailMessage("*****@*****.**", l.SubItems[3].Text, "UPDATED Electronic Reply Form (ERF) of " + l.Text, msgs);
                    messages[mi] = new MailMessage("*****@*****.**", l.SubItems[3].Text, "UPDATED Electronic Reply Form (ERF) of " + l.Text, msgs);
                    messages[mi].Attachments.Add(new Attachment(att_path));
                    cmailer c = new cmailer(nc);
                    c.send(messages[mi], new dummyobject(l, 2, mi));
                    mi++;
                }
            }
        }
Example #5
0
        void send_QUERY()
        {
            string msgs;
            int    mi = 0;

            if (lvList.Items.Count > 0)
            {
                foreach (ListViewItem l in lvList.Items)
                {
                    if (!l.Checked)
                    {
                        continue;
                    }

                    if (l.SubItems[3].Text.Length == 0)
                    {
                        l.SubItems[8].Text = "No email!";
                        continue;
                    }

                    msgs                      = (File.OpenText(Path.Combine(Program.rootfolder, @"TEMPLATE", "sp_request.html"))).ReadToEnd();
                    msgs                      = msgs.Replace("nName", Program.getFirstName(l.Text));
                    messages[mi]              = new MailMessage(uids[Program.nc_index] + "@gmail.com", l.SubItems[3].Text, "REQUEST TO RE-SEND SCANNED DOCUMENTS OF " + l.Text, msgs);
                    messages[mi].From         = new MailAddress(uids[Program.nc_index] + "@gmail.com", "MTGPHIL");
                    messages[mi].IsBodyHtml   = true;
                    messages[mi].BodyEncoding = ASCIIEncoding.Default;
                    cmailer c = new cmailer(nc[Program.nc_index]);
                    Program.nc_index++;
                    if (Program.nc_index == uids.Length)
                    {
                        Program.nc_index = 0;
                    }
                    c.send(messages[mi], new dummyobject(l, 2, mi));
                    mi++;
                }
            }
        }