0

Good evening to all. In my C# WinApp I sending an e-mail in this way:

mail.To.Add (new MailAddress ("firstname.lastname @ domain.com"));

Now, I would like to send an mail to a list of users stored in a table of MySQL database. Which is the best approach for this? Thanks in advance.

4

1 回答 1

1

创建您的查询并像这样遍历阅读器:

Sqldatareader rdr = sqlcommand_variable.ExecuteReader();
While (rdr.read()) {
    mail.To.Add(new MailAddress(rdr['firstname'] + "." + rdr['lastname'] + "@domain.com"));
}
于 2013-05-24T19:14:18.810 回答