【问题标题】:LinkButton to create Email in OutlookLinkBut​​ton 在 Outlook 中创建电子邮件
【发布时间】:2019-05-09 04:51:07
【问题描述】:

我有一个链接按钮,其文本显示从数据库中提取的电子邮件。我想 OnClick 在 Outlook 中创建新电子邮件并将此 LinkBut​​ton 文本放在 TO 部分,然后预填充主题。只要我手动输入电子邮件,代码就可以工作,但是当我告诉它读取 LinkBut​​ton.text 时,它什么也不做。甚至不打开 Outlook。

这工作--

EmailLB.OnClientClick = "window.location.href = 'mailto:someone@something.com?subject=MD Judicial Insurance Plan';"

这不是——

EmailLB.OnClientClick = "window.location.href = 'mailto:'" & EmailLB.Text & "'?subject=MD Judicial Insurance Plan';"

【问题讨论】:

    标签: vb.net email outlook


    【解决方案1】:

    您在 EmailLB.Text 和 ?subject 之间多了一个单引号。删除那个单引号 试试喜欢

    EmailLB.OnClientClick = "window.location.href = 'mailto:" & EmailLB.Text & "?subject=MD Judicial Insurance Plan';"
    

    【讨论】:

    • EmailLB.OnClientClick = "window.location.href = 'mailto:'" & EmailLB.Text & "?subject=MD 司法保险计划';"
    • 请显示EmailLB.OnClientClick = "window.location.href = 'mailto:'" & EmailLB.Text & "'?subject=MD Judicial Insurance Plan';"的结果
    • EmailLB.OnClientClick = "window.location.href = 'mailto:" & EmailLB.Text & "?subject=MD Judicial Insurance Plan';" 这看起来更好
    【解决方案2】:

    成功了!谢谢!

    EmailLB.OnClientClick = "window.location.href = 'mailto:" & EmailLB.Text & "?subject=MD 司法保险计划';"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-11-20
      • 2011-02-17
      • 2017-07-15
      • 1970-01-01
      • 2011-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多