如何从SQL数据库获取API链接中的电子邮件地址?

时间:2019-04-02 11:39:47

标签: vb.net

        Try

        Dim webClient As New System.Net.WebClient

        Dim result As String = webClient.DownloadString("http://emailsendingnotification.herokuapp.com/sendEmail/toemail@gmail.com/TheTransactionisSuccessfull")


    Catch ex As Exception

    End Try

在上面的代码中,而不是API链接中的toemail@gmail.com,我需要从在SQL Server 2014 Management Studio中创建的数据库中获取电子邮件ID?

        Try 

        Dim webClient As New System.Net.WebClient

        Dim result As String = webClient.DownloadString("http://emailsendingnotification.herokuapp.com/sendEmail/+TextEmailAddress.Text.ToString()+/TheTransactionisSuccessfull")

    Catch ex As Exception

    End Try

这是我尝试过的,但没有解决。

预期结果是应该在电子邮件地址上发送通知邮件,说明交易成功。

1 个答案:

答案 0 :(得分:1)

Dim result As String = webClient.DownloadString("http://emailsendingnotification.herokuapp.com/sendEmail/" & TextEmailAddress.Text.ToString() & "/TheTransactionisSuccessfull")

我看到您正在该文本框中发送字符串“ TextEmailAddress.Text.ToString()”而不是电子邮件作为字符串“ something@hello.com”

执行msgbox(结果),您将看到问题