Send-MailMessage throw error and send the email
See original GitHub issueSteps 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
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
[SOLVED] Error from Powershell When Sending Email
Solution: The error is suggesting the email from value is empty.... If this is going to be in powershell dump the .net and...
Read more >Catch error from Send-MailMessage cmdlet when called ...
1 Answer. Wrap the whole command in a try catch block and throw an explicit error. This will return a non-zero exit code....
Read more >Powershell send-MailMessage Exception
Found the solution. The credential used does not have permissions to send email as support@domain.com in -From "support@domain.com".
Read more >Powershell Send-MailMessage Error
Brings up error:Send-MailMessage : The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5 ...
Read more >How to throw an exception and send email as alert - Help
Hello I want to know how to send an email as notification/alerts in UiPath after successful Job or Exceptions? thanks in advance Ayyoub....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@adityapatwardhan In my opinion this issue can be closed. But another issue or PR should be made to improve the user experience when using non-valid email addresses in
-To
,-Cc
and-Bcc
. It’s on my To-Do, but other PRs for this cmdlet are more important, which I want to fix first.@ThreeFive-O Thanks for the detailed analysis. Can this issue be closed since, the cmdlet is behaving as expected?