首页 > 解决方案 > 如何从 SQL 数据库中获取 API 链接中的电子邮件地址?

问题描述

        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

这是我尝试过的,但没有任何结果。

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

标签: vb.net

解决方案


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

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

做 msgbox(result) 你会看到问题


推荐阅读