Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looping through Email Recipients and Displaying Names 1

Status
Not open for further replies.

net123

Programmer
Oct 18, 2002
167
US
Hello:

I have a web email application that sends out emails located in SQL Server 2k. I have a reader as follows in my code:

conn.Open();
dr = comm.ExecuteReader(CommandBehavior.CloseConnection);
while(dr.Read())
{
mailer.To = dr[0].ToString();
SmtpMail.SmtpServer = "xx.xx.xx.xxx";
SmtpMail.Send(MyMailer);
}
dr.Close();
[/blue]
I tried putting something like this:

lblRecipients.Text = mailer.To;
[/blue]
After the SmtpMail.Send(MyMailer);[/blue] but nothing is listed.

Can someone tell me what I'm missing so I can display all of the names that this is being sent to?
 
Try lblRecipients.Text += dr[0].ToString() + &quot;<br>&quot;;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top