首页 > 解决方案 > 无法点击 Gmail 中的下载链接

问题描述

我的服务创建了一封发送给用户的电子邮件。在电子邮件中,有一个指向我的服务的链接,用于下载文件。

电子邮件的正文如下所示:

 Click to <a href=http://localhost:1234/download?token=mytoken target="_blank">download</a>

带引号:

Click to <a href="http://localhost:1234/download?token=mytoken" target="_blank">register</a>

我在端点上的控制器如下所示:

[HttpGet]
[AllowAnonymous]
public ActionResult Get(string token)
{
    ...
    var result = new FileContentResult(System.IO.File.ReadAllBytes("mypath"), "application/exe")
    {
        FileDownloadName = "myFile.msi"
    };
    return result;
}

标签: c#html.net-coregmail

解决方案


推荐阅读