[Solved] User activation link points to localhost in IIS

on Feb 25, 2020 12:02 AM


Based on this article: Send user Confirmation email after Registration with Activation Link in ASP.Net

I am having problem to get the correct link of activation. It always points to localhost even if i use internet domain.

string activationLink = "<a href = 'http://www.test.com/SignUpSuccess.aspx?ActivationCode=" + activationCode + "'>Click here to activate your account</a>";
Msg.Body = Msg.Body.Replace("%activationLink%", activationLink.ToString());
<span style="font-family:Georgia; font-weight:bold; font-size:18px; color:#000000;"> %activationLink% </span>

the link received on email always points to the following:


I need the following:


Many thanks in advance

Download FREE API for Word, Excel and PDF in ASP.Net: Download
on Mar 06, 2020 06:57 PM

The issue occurs when i tried to publish the website in the wrong way (transfering file and folder to production server manually without using the publish tool for example Visual Studio).

So that is why the localhost link was still remaining.