URL not working ASP MVC in SMS function

71 views Asked by At

I am working on a reset password function where the new link to reset the password is going to be sent by SMS. But when the URL link is genereted and send to the mobile number it is not clickable for some reason. I have checked around a little and i have seen that it could be android specific. Any suggestions?

var link = _urlProvider.ToAbsoluteUrl(Url.Action("VerifySmsCode", "Account", new { enteredCode = code }));

        var body = string.Format("Verifiera ditt telefonnumer via följande länk: " +
            Environment.NewLine + " {0} ",
            link);

        _smsGateway.Send(Installation.Name, body, Buyer.Msisdn.Value);

        ViewBag.Message = "Ett SMS med verifieringskod har skickats";

This is my code for the function. The link is generated correctly but it is not clickable in android phones?

public string ToAbsoluteUrl(string relative)
    {
        var request = System.Web.HttpContext.Current.Request;
        return string.Format("{0}://{1}{2}{3}", (request.IsSecureConnection) ? "https" : "http",
            request.Url.Host, (request.Url.Port == 80) ? "" : ":" + request.Url.Port.ToString(),
            VirtualPathUtility.ToAbsolute(relative));
    }
0

There are 0 answers