Make absolute link in email

Make absolute link in email

hi ,

I am creating a function which send an email to user ask for doing something by click on the link . My email send out with a absolute link but host name all ways "localhost". is there is any function to get correct application host name?

Also if your current links are returning localhost as the hostname it sounds like you might need to configure your Outsystems installation through Service Centre and configure the hostname.


Suppose you want a link in your e-mail such that when you click that link, the control is redirected to some page of your application.
For that may be you can try this option in your e-mail.

"http://" + GetServerName() + GetOwnerURLPath() + "Client_Report.aspx?/

Where GetServerName() is a method which you can find in the RichWidgets or if not, you will have to add it.

Hope this helps.

Nikhil Shravage.

Hi Truong,

Url's inside emails are always absolute links and you can configure the hostname in Service Center like Richard suggested. There is no need to try and write the url's manually yourself.

João Rosado

we have two zones. one for internal apps and one for public apps.
the hostname is different for each zone. e.g. public url vs internal url
however the service center is shared
how can i enter different hostnames for each zone?
Hi Fabian,

Did you find a solution when having two zones?

Hi Hugo

We ended up writing a .NET extension that will give us the correct HostName of the server where the espace is running. We called it GetHostName()

The expression in the email for the link is like this
<a href=""https://" + GetHostName() + "/" + GetEntryEspaceName() + "/FireFuelTracking.aspx"">Withdrawal by equipment</a>