per ora sono arrivato qui
codice:
Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
        'Prendo i dati da smsservergateway e li confronto con smspanel
        Dim Comando_SmsGateway As New OleDbCommand
        Dim Comando_SmsPanel As New OleDbCommand
        Dim Adapter_SmsGateway As New OleDbDataAdapter
        Dim Adapter_SmsPanel As New OleDbDataAdapter
        Dim Reader_SmsGateway As OleDbDataReader
        Dim Reader_SmsPanel As OleDbDataReader
        Dim ANUMBER As String
        Dim SMSMESSAGE As String
        Dim RECEIVEDDATE As Date
        Dim NUMERO As String
        Dim EMAIL As String

        Comando_SmsGateway.Connection = Connessione_server
        Comando_SmsGateway.CommandText = "SELECT * FROM INBOX"
        Comando_SmsGateway.CommandType = CommandType.Text
        Adapter_SmsGateway.SelectCommand = Comando_SmsGateway
        Connessione_server.Open()
        Reader_SmsGateway = Comando_SmsGateway.ExecuteReader()

        While Reader_SmsGateway.Read
            ANUMBER = Reader_SmsGateway("ANUMBER")
            SMSMESSAGE = Reader_SmsGateway("SMSMESSAGE")
            RECEIVEDDATE = Reader_SmsGateway("RECEIVEDDATE")
            Comando_SmsPanel.Connection = Connessione
            Comando_SmsPanel.CommandText = "SELECT * FROM numeri INNER JOIN email ON email.id_email = numeri.idemail WHERE numero = @ANUMBER"
            Comando_SmsPanel.CommandType = CommandType.Text
            Comando_SmsPanel.Parameters.AddWithValue("@ANUMBER", ANUMBER)
            Adapter_SmsPanel.SelectCommand = Comando_SmsPanel
            Connessione.Open()
            Reader_SmsPanel = Comando_SmsPanel.ExecuteReader()
            Try
                NUMERO = Reader_SmsPanel("numero")
                EMAIL = Reader_SmsPanel("email")
            Catch Eccezione As Exception
                 Exit While
            End Try
            Connessione.Close()
        End While
        Connessione_server.Close()
    End Sub
ma non so inviare la email