Click here to Skip to main content
15,915,772 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Datagrid Questions Pin
thebread16-Aug-05 9:47
thebread16-Aug-05 9:47 
GeneralRe: Datagrid Questions Pin
dptalt17-Aug-05 7:31
dptalt17-Aug-05 7:31 
Generalcalling batch files from vb.net Pin
Anonymous16-Aug-05 3:31
Anonymous16-Aug-05 3:31 
GeneralRe: calling batch files from vb.net Pin
Dave Kreskowiak16-Aug-05 4:48
mveDave Kreskowiak16-Aug-05 4:48 
QuestionHow to take face pattern....? Pin
M SELVA KUMAR16-Aug-05 2:14
M SELVA KUMAR16-Aug-05 2:14 
AnswerRe: How to take face pattern....? Pin
Colin Angus Mackay16-Aug-05 3:48
Colin Angus Mackay16-Aug-05 3:48 
AnswerRe: How to take face pattern....? Pin
Dave Kreskowiak16-Aug-05 4:46
mveDave Kreskowiak16-Aug-05 4:46 
GeneralSending email to multiple recipients Pin
macca2416-Aug-05 1:22
macca2416-Aug-05 1:22 
I want to send an email to a number of people. The people I want to send to are stored in a database table. I want to send an email that includes a message and includes an OrderNumber which is stored in the database table. The recipients email address is stored in the database table also.

I am not sure what way to retrieve the information and to send it. I think I should read the information from the table using a sql query such as:

Param = SqlCom.Parameters.Add("@OrderNumber", SqlDbType.VarChar, 4)

Param.Direction = ParameterDirection.Output

Param = SqlCom.Parameters.Add("@MailAddress", SqlDbType.VarChar, 20)

Param.Direction = ParameterDirection.Output

Conn.Open()

SqlCom.ExecuteNonQuery()

Conn.Close()

OrderNumber = Trim(SqlCom.Parameters("@OrderNumber").Value)

RecipientAddress = Trim(SqlCom.Parameters("@MailAddress").Value)

I think I should read it using a loop and the send the mails to a recipient using the following code:

Dim dr As SqlDataReader


While dr.Read()

Mail.To = dr("OrderNumber").ToString()
Mail.Body = TextBox5.Text
Mail.From = "jmcconalogue"
SmtpMail.SmtpServer = "donegal-mail"
SmtpMail.Send(Mail)

End While

dr.Close()



Does anyone know if this will keep looping through the table and keep sending emails to all the recipients listed in the datbase table as there may be quite a few in the table?

Anyone a better way to do this?

macca
GeneralRe: Sending email to multiple recipients Pin
Alsvha16-Aug-05 3:58
Alsvha16-Aug-05 3:58 
GeneralArray inside a collection Pin
dlarkin7716-Aug-05 0:23
dlarkin7716-Aug-05 0:23 
GeneralRe: Array inside a collection Pin
Dave Kreskowiak16-Aug-05 4:44
mveDave Kreskowiak16-Aug-05 4:44 
GeneralRe: Array inside a collection Pin
Anonymous16-Aug-05 7:05
Anonymous16-Aug-05 7:05 
GeneralVB.Net in Linux Pin
len_ems15-Aug-05 23:50
len_ems15-Aug-05 23:50 
GeneralRe: VB.Net in Linux Pin
Kevin McFarlane16-Aug-05 5:54
Kevin McFarlane16-Aug-05 5:54 
GeneralRe: VB.Net in Linux Pin
len_ems16-Aug-05 23:34
len_ems16-Aug-05 23:34 
GeneralUrgent Pin
Anonymous15-Aug-05 20:27
Anonymous15-Aug-05 20:27 
GeneralRe: Urgent Pin
Christian Graus15-Aug-05 20:28
protectorChristian Graus15-Aug-05 20:28 
GeneralRe: Urgent Pin
Anonymous16-Aug-05 2:51
Anonymous16-Aug-05 2:51 
GeneralRe: Urgent Pin
toxcct16-Aug-05 4:02
toxcct16-Aug-05 4:02 
GeneralRe: Urgent Pin
Dave Kreskowiak16-Aug-05 4:37
mveDave Kreskowiak16-Aug-05 4:37 
QuestionNumbers in letters? Pin
Hadi Fakhreddine15-Aug-05 20:17
Hadi Fakhreddine15-Aug-05 20:17 
AnswerRe: Numbers in letters? Pin
Steve Pullan15-Aug-05 21:58
Steve Pullan15-Aug-05 21:58 
Generalhelp me share my folder Pin
Your Code15-Aug-05 17:13
Your Code15-Aug-05 17:13 
GeneralNewbie here Pin
Cx-15-Aug-05 16:04
Cx-15-Aug-05 16:04 
GeneralRe: Newbie here Pin
Christian Graus15-Aug-05 16:14
protectorChristian Graus15-Aug-05 16:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.