private void button2_Click(object sender, EventArgs e) { // gmail -> qq SmtpClient MailClient = new SmtpClient(); MailClient.Host = "smtp.gmail.com"; MailClient.Port = 587; MailClient.Credentials = new NetworkCredential("gmail_zhanghao", "password"); MailClient.EnableSsl = true; MailMessage Email = new MailMessage(); Email.From = new MailAddress("gmail_zhanghao@gmail.com"); Email.Subject = "Subject test"; Email.Body = "Body content"; Email.IsBodyHtml = false; Email.To.Add("dest@qq.com"); Attachment EmailAttachment = new Attachment(@"C:\log.zip"); Email.Attachments.Add(EmailAttachment); MailClient.Send(Email); } private void button3_Click(object sender, EventArgs e) { // qq -> gmail SmtpClient MailClient = new SmtpClient(); MailClient.Host = "smtp.qq.com"; MailClient.Port = 587; MailClient.Credentials = new NetworkCredential("qqqq@qq.com", "password"); MailClient.EnableSsl = true; MailMessage Email = new MailMessage(); Email.From = new MailAddress("qqqq@qq.com"); Email.Subject = "Subject test"; Email.Body = "Body content"; Email.IsBodyHtml = false; Email.To.Add("dest@gmail.com"); Attachment EmailAttachment = new Attachment(@"C:\log.zip"); Email.Attachments.Add(EmailAttachment); MailClient.Send(Email); } private void button4_Click(object sender, EventArgs e) { // hotmail -> gmail SmtpClient MailClient = new SmtpClient(); MailClient.Host = "smtp.live.com"; MailClient.Port = 587; MailClient.Credentials = new NetworkCredential("src@hotmail.com", "password"); MailClient.EnableSsl = true; MailMessage Email = new MailMessage(); Email.From = new MailAddress("src@hotmail.com"); Email.Subject = "Subject test"; Email.Body = "Body content"; Email.IsBodyHtml = false; Email.To.Add("dest@gmail.com"); Attachment EmailAttachment = new Attachment(@"C:\log.zip"); Email.Attachments.Add(EmailAttachment); MailClient.Send(Email); }