18.4. Working with Message Headers
Frequently, we need to set our message with additional headers that will signal the priority, Reply-To address, and many other things that we, our mail client, or our mail server can recognize, such as a request for sending back a message read notification. The message priority and Reply-To address are conveniently exposed as properties of the MailMessage class:
$message.Priority = [System.Net.Mail.MailPriority] "High" $message.ReplyTo = email@example.com
To accommodate setting those properties in our script, we need to add two more parameters: $priority and $replyTo. They default to $null and an empty string respectively, and we need to add some checks to skip configuring them if the parameters have not been ...