Skip to content

Add Obsolete message to Send-MailMessage - #9178

Merged
Travis Plunk (TravisEz13) merged 7 commits into
PowerShell:masterfrom
TravisEz13:marke_send_mailmessage_obsolete
Mar 22, 2019
Merged

Travis Plunk (TravisEz13) merged 7 commits into
PowerShell:masterfrom
TravisEz13:marke_send_mailmessage_obsolete

Conversation

@TravisEz13

@TravisEz13 Travis Plunk (TravisEz13) commented Mar 20, 2019 •

Copy link
Copy Markdown
Member

PR Summary

Add Obsolete message to Send-MailMessage

PR Context

See PowerShell/PowerShell-RFC#160

PR Checklist

/// <summary>
/// Implementation for the Send-MailMessage command.
/// </summary>
[Obsolete("This cmdlet only supports sending mail from insecure SMTP servers. While there is no immediate replacement available in PowerShell, we recommend you do not use Send-MailMessage at this time.")]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"from"? Maybe "insecure connect to"?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pinged Joey Aiello (@joeyaiello) who wrote the message

/// <summary>
/// Implementation for the Send-MailMessage command.
/// </summary>
[Obsolete("This cmdlet only supports sending mail from insecure SMTP servers. While there is no immediate replacement available in PowerShell, we recommend you do not use Send-MailMessage at this time.")]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add test to validate.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WarningVariables does not capture this warning.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try using powershell.invoke and then check the streams.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have a xUnit test suite for all public APIs to have API contract.


$null = $powershell.AddCommand("Send-MailMessage").AddParameters($InputObject).AddParameter("ErrorAction","SilentlyContinue")

#Send-MailMessage @InputObject -ErrorAction SilentlyContinue

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this.

…d-MailMessage.cs

Co-Authored-By: TravisEz13 <travis.plunk@microsoft.com>
…d-MailMessage.cs

Co-Authored-By: TravisEz13 <travis.plunk@microsoft.com>
@TravisEz13
Travis Plunk (TravisEz13) merged commit 94616f1 into PowerShell:master Mar 22, 2019
@TravisEz13
Travis Plunk (TravisEz13) deleted the marke_send_mailmessage_obsolete branch March 22, 2019 19:52
@TravisEz13 Travis Plunk (TravisEz13) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Mar 22, 2019
Travis Plunk (TravisEz13) added a commit that referenced this pull request Mar 25, 2019
Add Obsolete message to Send-MailMessage

## PR Context

See PowerShell/PowerShell-RFC#160

Co-authored-by: Steve Lee <slee@microsoft.com>
Co-authored-by: Ilya <darpa@yandex.ru>
# Conflicts:
#	test/powershell/Modules/Microsoft.PowerShell.Utility/Send-MailMessage.Tests.ps1
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Add Obsolete message to Send-MailMessage

## PR Context

See PowerShell/PowerShell-RFC#160

Co-authored-by: Steve Lee <slee@microsoft.com>
Co-authored-by: Ilya <darpa@yandex.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants