-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Feature: Support Reply-To field in Send-MailMessage #8719
Copy link
Copy link
Closed
Labels
First-Time-IssueEasy issues first time contributors can work on to learn about this projectEasy issues first time contributors can work on to learn about this projectIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Metadata
Metadata
Assignees
Labels
First-Time-IssueEasy issues first time contributors can work on to learn about this projectEasy issues first time contributors can work on to learn about this projectIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Summary of the new feature/enhancement
RFC 5322, section 3.6.2, defines the Reply-To field in a message like this:
This field is used pretty frequently in larger organizations, and is respected by most e-mail clients as the default address to use for the default Reply action.
Currently, PowerShell's Send-MailMessage cmdlet doesn't provide a user the option to add this field. Users' current options are either to set the From field to the desired reply address, or go around Send-MailMessage to use the underlying System.Net.Mail.MailMessage class directly. The first is not an acceptable workaround in many cases, and the second requires the user to re-invent the wheel by recreating all of the behavior of Send-MailMessage.
As a user, I'd like to see a -ReplyTo parameter added to Send-MailMessage to allow me to use the Reply-To field directly within Send-MailMessage.
Proposed technical implementation details (optional)
The MailMessage class already supports the ReplyToList property, which is a MailAddressCollection just like the To, CC, and BCC fields (which are already supported and use a helper method to handle them). I'd suggest adding the -ReplyTo parameter to Send-MailMessage, adding support for the ReplyToList property to this helper function, and adding the plumbing to call that function with the value of Send-MailMessage's -ReplyTo parameter.
The end-user experience should look like this: