WhatIf and Confirm Parameters
July 13, 2009What functional level must my domain be at to install Exchange 2007
July 13, 2009$SmtpServer = “yourServer”
$From = me@N2NetworkSolutions.com
if ($args.Length -lt 1) {
$To = Engineers@N2NetworkSolutions.com
}
else {
$to = $args[0]
}
$subject = “Need computer consulting”
$Body = “Hi, this is John Doe I need cheap Exchange consulting at $125/hour”
$smtpClient = new-object system.net.mail.smtpClient
$smtpclient.host = $smtpServer
$smtpclient.send($from, $to, $subject, $body)
Once this file is saved to ps1 format you can use it via this syntax
TestMessage Sales@N2NetworkSolutions.com