Send-MailMessage

Kaylah Henderson 1 Reputation point
2022-07-06T02:00:15.427+00:00

I'm using windows powershell and it is asking the To: over and over again when I try to send an email on it. How do I stop this?

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,274 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Rafael da Rocha 5,071 Reputation points
    2022-07-06T02:19:08.417+00:00

    If the To[x]: input is blank it shouldn't ask again.

    Is this on the console or part of a script?

    0 comments No comments

  2. Rich Matheisen 43,926 Reputation points
    2022-07-06T14:31:53.843+00:00

    Have you provided any recipients at all? IOW, have you used either the -CC or -BCC parameters?

    Also, a message without a "To:" header in the RFC822 message headers would look pretty suspicious to spam filters.

    If you don't want to disclose the intended recipients in the RFC822 headers then it's a good idea to add the -TO parameter with an address like "DoNotReply@your-domain.tld" and assign the DoNotReply@your-domain.tld to a distribution group with no members -- that will effectively discard any replies, NDRs, etc. sent in response to the email.

    0 comments No comments