Im new here in this forum and in visual basic programming. im using microsoft visual studio- VB.net
here's my code:
Try
cnn.Open()
' query the email address of the students in tbl_students'
Dim sQuery As String = "Select std_eadd from tbl_students"
Dim cmdCommand As New MySqlClient.MySqlCommand(sQuery, cnn)
cmdCommand.ExecuteNonQuery()
Dim dbaseStd As New DataTable("Result")
Dim sqlAdapter As New MySqlClient.MySqlDataAdapter()
sqlAdapter.SelectCommand = cmdCommand
sqlAdapter.Fill(dbaseStd)
dim recipient as string
recipient = ?? The selected std_eadd query?
'code for sending mail'
SmtpServer.Credentials = New Net.NetworkCredential("jhekuzai@gmail.com", "********")
SmtpServer.Port = 587
SmtpServer.Host = "smtp.gmail.com"
SmtpServer.EnableSsl = True
SmtpServer.EnableSsl = True
mail.To.Add(recipient)
mail.From = New MailAddress("DSSniRobManosca@yahoo.com")
mail.Subject = (txtSubject.Text)
mail.Body = (rtxtMsg.Text)
SmtpServer.Send(mail)
Catch ex As MySqlClient.MySqlException
MsgBox(ex.Message.ToString)
Finally
cnn.Close()
txtSubject.Clear()
rtxtMsg.Clear()
End Try
*Pls Help me :| for my final defense in school...
here's my code:
Try
cnn.Open()
' query the email address of the students in tbl_students'
Dim sQuery As String = "Select std_eadd from tbl_students"
Dim cmdCommand As New MySqlClient.MySqlCommand(sQuery, cnn)
cmdCommand.ExecuteNonQuery()
Dim dbaseStd As New DataTable("Result")
Dim sqlAdapter As New MySqlClient.MySqlDataAdapter()
sqlAdapter.SelectCommand = cmdCommand
sqlAdapter.Fill(dbaseStd)
dim recipient as string
recipient = ?? The selected std_eadd query?
'code for sending mail'
SmtpServer.Credentials = New Net.NetworkCredential("jhekuzai@gmail.com", "********")
SmtpServer.Port = 587
SmtpServer.Host = "smtp.gmail.com"
SmtpServer.EnableSsl = True
SmtpServer.EnableSsl = True
mail.To.Add(recipient)
mail.From = New MailAddress("DSSniRobManosca@yahoo.com")
mail.Subject = (txtSubject.Text)
mail.Body = (rtxtMsg.Text)
SmtpServer.Send(mail)
Catch ex As MySqlClient.MySqlException
MsgBox(ex.Message.ToString)
Finally
cnn.Close()
txtSubject.Clear()
rtxtMsg.Clear()
End Try
*Pls Help me :| for my final defense in school...