How can i get the LocalhostName, Ip of the machine hosting the Application. For development it would be localhost for deployment something different. This i need to initialize the SmtpClient to send emails through application
SmtpClient emailClient = new SmtpClient("host","port");//port is optional
i am looking for a permanent solution, no workarounds and no sniffing from response, request and this could be spoofed[hope i am not crazy because no one can spoof the servers data in headers can they?]
If you want to configure SmtpClient class, you should have a look at the system.net > mailsettings entry of the web.config : http://msdn.microsoft.com/en-us/library/w355a94k.aspx
And instanciate the StmpClient with parameterless constructor