Dim countrow, i As Integer
strSQL = "SELECT * FROM usert"
Dim strEmailTo As String = ""
dtAdapter = New OleDbDataAdapter(strSQL, objConn)
dtAdapter.Fill(ds, "usert")
countrow = ds.Tables("usert").Rows.Count
For i = 0 To countrow - 1
If ds.Tables("usert").Rows(i)("emailto").ToString() = "True" Then
strEmailTo = strEmailTo & ds.Tables("usert").Rows(i)("email").ToString() & ","
End If
Next
strSQL = "SELECT * FROM usert where name = '" & Session("UserName") & "'"
dtAdapter = New OleDbDataAdapter(strSQL, objConn)
dtAdapter.Fill(ds, "userta")
Dim strEmailFrom As String = ds.Tables("userta").Rows(0)("email").ToString()
Dim mailmsg As New MailMessage(strEmailFrom, strEmailTo)
Dim strbody As String
mailmsg.Subject = "Request Job ID is " & jobNo.Text
mailmsg.IsBodyHtml = True
strbody = "<html><body>"
strbody = strbody & "I Would to request Tooling / Fixture as detail below "
strbody = strbody & " <br>aaa"
strbody = strbody & "<br>bbb"
strbody = strbody & "<br><br><br> Thank you . . . "
strbody = strbody & "</body></html>"
mailmsg.Body = strbody
Dim smtp As New SmtpClient()
smtp.Host = "mailhub.sanmina-sci.com"
Try
smtp.Send(mailmsg)
Catch ex As Exception
Response.Write(ex.Message)
End Try