I have some code that generates an email and I want to include the actual server machine name that is running in the body of the email. (It's a clustered web environment, so I want to find out what actual machine is sending the email.)
I know I can use Request.Url.AbsoluteUri
, but that gives me the URL (like www.mysite.com/MyController/Action) instead of the raw actual machine name - which might be MACH3234k323).
Is there a way that I can get the actual server machine's name?
Use System.Environment.MachineName
The name of the machine will be here:
System.Environment.MachineName
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With