Y
YQzhang
Guest
Now I have a winform which can send emails to mailboxes that are searched according to the conditions form SQL.And for the next goal, I hope that within the 7 days, if I haven't received the reply from the owner of the mailbox, I can forward another email on the basis of the first one.How can I do it?
Below is the code that I send the mail:
private void button2_Click(object sender, EventArgs e)
{
MailMessage msg = new MailMessage();
System.Net.NetworkCredential aCred = new System.Net.NetworkCredential("affhofih092@163.com", "Zydhauhf");
SmtpClient client = new SmtpClient();
client.Host = "smtp.163.com ";
client.UseDefaultCredentials = false;
client.Credentials = aCred;
if (dataGridView1.RowCount > 0)
{
for (int i = 0; i < dataGridView1.RowCount - 1; i++)
{
msg.Subject = "TEST";
msg.Body = this.textBox3.Text + dataGridView1.Rows.Cells[0].Value.ToString();
msg.From = new MailAddress("affhofih092@163.com");
msg.To.Add(dataGridView1.Rows.Cells[4].Value.ToString());
client.Send(msg);
}
}
}
Continue reading...
Below is the code that I send the mail:
private void button2_Click(object sender, EventArgs e)
{
MailMessage msg = new MailMessage();
System.Net.NetworkCredential aCred = new System.Net.NetworkCredential("affhofih092@163.com", "Zydhauhf");
SmtpClient client = new SmtpClient();
client.Host = "smtp.163.com ";
client.UseDefaultCredentials = false;
client.Credentials = aCred;
if (dataGridView1.RowCount > 0)
{
for (int i = 0; i < dataGridView1.RowCount - 1; i++)
{
msg.Subject = "TEST";
msg.Body = this.textBox3.Text + dataGridView1.Rows.Cells[0].Value.ToString();
msg.From = new MailAddress("affhofih092@163.com");
msg.To.Add(dataGridView1.Rows.Cells[4].Value.ToString());
client.Send(msg);
}
}
}
Continue reading...