Reblogged from Prashanth Jayaram :
This article walks through how to list SQL Server configurable and non-configurable instance settings using PowerShell and sending an automated email to a listed users. The Function SendEmail has MailServerName as one of its parameter. Please change accordingly.The following code loads the SMO(SMO Server Objects) assemblies.
Import the SQLPS module, and create a new SMO Server object and Specify the DisableNameChecking parameter if you want to suppress the warning about Encode-Sqlname and Decode-Sqlname.