Skip to content

Send-MailMessage throw error and send the email #2646

@EliadTech

Description

@EliadTech

Steps to reproduce

Run Send-MailMessage with CC or BCC, but without TO, and with BodyAsHTML.

Expected behavior

Either throw error and break (because TO is empty) or send the email (to CC or BCC) without an error.

Actual behavior

You get an error that the email address is invalid and the email is sent but empty.

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.0.9740.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.34014
BuildVersion                   6.3.9740.0
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-AnsweredThe question is answered.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdletsgeneral cmdlet issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions