[Solved] User activation link points to localhost in IIS

Kibock
 
on Feb 25, 2020 12:02 AM
1899 Views

Hi,

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:

http://localhost:64278/SignUpSuccess?ActivationCode=2e67380d-7ccb-4934-a5dd-7fa73e82060b

I need the following:

http://www.test.com/SignUpSuccess?ActivationCode=2e67380d-7ccb-4934-a5dd-7fa73e82060b

Many thanks in advance

Download FREE API for Word, Excel and PDF in ASP.Net: Download
Kibock
 
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.