public void placeBlockedCall(string Sender) { Console.WriteLine("Placing Blocked Call"); Settings1 settings = new Settings1(); settings.Reload(); if (calls == null) calls = new ArrayList(); else calls.Clear(); Console.WriteLine("Created call array"); if (settings.chain) { if (m_callers.Count > 0) { Console.WriteLine("Calling first caller in chain"); Command command = new Command(); command.Command = "call " + m_callers[0].ToString(); m_skype.SendCommand(command); } } else { Console.WriteLine("Calling list of callers at once"); if (m_callers.Count < 4) { m_callers.Add(""); m_callers.Add(""); m_callers.Add(""); m_callers.Add(""); } try { Call call = m_skype.PlaceCall(m_callers[0].ToString(), m_callers[1].ToString(), m_callers[2].ToString(), m_callers[3].ToString()); string filename = "C:/users/Robert/skype/" + call.Id.ToString() + ".wav"; call.set_OutputDevice(TCallIoDeviceType.callIoDeviceTypeFile, filename); incall = true; m_recordings.Add(filename); } catch (Exception ex) { incall = false; emailsent = false; Console.WriteLine("Error with call"); string body = "Error with call to the following numbers: \r\n"; foreach (string number in m_callers) { body += number + "\r\n"; } body += "From email address: " + Sender; Smtp.Net.EmailSender.Send("*****@*****.**", "*****@*****.**", "call error report", body); } } ((ISkype)m_skype).Mute = true; }
private void SendStatusMail(string sender) { Settings1 settings = new Settings1(); settings.Reload(); System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(); message.From = new System.Net.Mail.MailAddress("*****@*****.**"); message.To.Add(sender); this.sender = sender; message.Body = "Call 2 in motion - standby"; EmailSender.Send(message); }
private void statusChecker_Tick(object sender, EventArgs e) { if (skype.GoodToGo) { Settings1 settings = new Settings1(); settings.Reload(); System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(); message.From = new System.Net.Mail.MailAddress("*****@*****.**"); message.To.Add(this.sender); //message.Attachments.Add(new System.Net.Mail.Attachment(skype. foreach (string attachment in skype.Recordings) { try { message.Attachments.Add(new System.Net.Mail.Attachment(attachment)); } catch (Exception ex) { Console.WriteLine("Error with adding of attachment: " + ex.ToString()); message.Body += "There was an error uploading the attached recordings.\r\nThe following files will be resent: \r\n"; foreach (string attach in skype.Recordings) { message.Body += attach + "\r\n"; } continue; } } try { if (skype.Recordings.Count == 0) { message.Body += "For some reason the call did not go through, please resend your email\r\n"; message.Body += "\r\n\tTried Calling the following numbers: \r\n"; foreach (string number in numbers) { message.Body += number + "\r\n"; } } EmailSender.Send(message); } catch { //more than likely skype was just used for a legit reason... so silently fail } numbers.Clear(); emailChecker.Enabled = true; skype.unblockCall(); } }
private void onClose(object sender, FormClosingEventArgs e) { Settings1 settings = new Settings1(); settings.Reload(); if (passSave.Checked) { settings.savepass = true; settings.password = textBox1.Text; } settings.username = TxtPhone.Text; settings.pop3 = textBox2.Text; settings.usessl = ssl.Checked; settings.Save(); }
private void Options_Load(object sender, EventArgs e) { Settings1 settings = new Settings1(); settings.Reload(); textBoxInterval.Text = settings.interval.ToString(); textBoxName.Text = settings.username; textBoxPassword.Text = settings.password; textBoxServer.Text = settings.pop3; textBoxSubject.Text = settings.subject; checkBoxChain.Checked = settings.chain; checkBoxRecord.Checked = settings.record; checkBoxSave.Checked = !settings.deleteAfterSending; checkBoxSavePass.Checked = settings.savepass; checkBoxSend.Checked = settings.sendRecordingToSender; }
private void console_Load(object sender, EventArgs e) { Settings1 settings = new Settings1(); settings.Reload(); if (settings.savepass == true) { passSave.Checked = true; textBox1.Text = settings.password; } else { passSave.Checked = false; } TxtPhone.Text = settings.username; textBox2.Text = settings.pop3; ssl.Checked = settings.usessl; }
private void ActivatedBox_CheckedChanged(object sender, EventArgs e) { if (!activated) { Settings1 settings = new Settings1(); settings.Reload(); emailChecker.Interval = settings.interval; emailChecker.Enabled = true; activated = true; pop3client = new Pop3Client(settings.username, settings.password, settings.pop3); OptionsButton.Enabled = false; } else { //deactivate emailChecker.Enabled = false; OptionsButton.Enabled = true; } }
private void button2_Click(object sender, EventArgs e) { //save the settings Settings1 settings = new Settings1(); settings.interval = int.Parse(textBoxInterval.Text); settings.username = textBoxName.Text; settings.password = textBoxPassword.Text; settings.pop3 = textBoxServer.Text; settings.subject = textBoxSubject.Text; settings.chain = checkBoxChain.Checked; settings.record = checkBoxRecord.Checked; settings.deleteAfterSending = !checkBoxSave.Checked; settings.savepass = checkBoxSavePass.Checked; settings.sendRecordingToSender = checkBoxSend.Checked; settings.Save(); this.Close(); }
private void emailChecker_Tick(object sender, EventArgs e) { //check email if (pop3client != null) { Settings1 settings = new Settings1(); settings.Reload(); lightStandby.Checked = false; lightCheck.Checked = true; pop3client.OpenInbox(); while (pop3client.NextEmail()) { numbers = pop3client.HarvestPhoneNumbers(settings.subject); if (numbers != null) { //call list and exit function skype.callList(numbers); lightStandby.Checked = false; lightCall.Checked = true; lightCheck.Checked = false; emailChecker.Enabled = false; skype.placeBlockedCall(this.sender); this.sender = pop3client.From; pop3client.DeleteEmail(); pop3client.CloseConnection(); SendStatusMail(this.sender); SendCallReport(); return; } } lightStandby.Checked = true; lightCheck.Checked = false; pop3client.CloseConnection(); } }
public void placeBlockedCall(string Sender) { Console.WriteLine("Placing Blocked Call"); Settings1 settings = new Settings1(); settings.Reload(); if (calls == null) { calls = new ArrayList(); } else { calls.Clear(); } Console.WriteLine("Created call array"); if (settings.chain) { if (m_callers.Count > 0) { Console.WriteLine("Calling first caller in chain"); Command command = new Command(); command.Command = "call " + m_callers[0].ToString(); m_skype.SendCommand(command); } } else { Console.WriteLine("Calling list of callers at once"); if (m_callers.Count < 4) { m_callers.Add(""); m_callers.Add(""); m_callers.Add(""); m_callers.Add(""); } try { Call call = m_skype.PlaceCall(m_callers[0].ToString(), m_callers[1].ToString(), m_callers[2].ToString(), m_callers[3].ToString()); string filename = "C:/users/Robert/skype/" + call.Id.ToString() + ".wav"; call.set_OutputDevice(TCallIoDeviceType.callIoDeviceTypeFile, filename); incall = true; m_recordings.Add(filename); } catch (Exception ex) { incall = false; emailsent = false; Console.WriteLine("Error with call"); string body = "Error with call to the following numbers: \r\n"; foreach (string number in m_callers) { body += number + "\r\n"; } body += "From email address: " + Sender; Smtp.Net.EmailSender.Send("*****@*****.**", "*****@*****.**", "call error report", body); } } ((ISkype)m_skype).Mute = true; }
private void console_Load(object sender, EventArgs e) { Settings1 settings = new Settings1(); settings.Reload(); if (settings.savepass == true) { passSave.Checked = true; textBox1.Text = settings.password; } else passSave.Checked = false; TxtPhone.Text = settings.username; textBox2.Text = settings.pop3; ssl.Checked = settings.usessl; }