Help with emailing multiple people using powershell

I need to email a file to multiple recipients.  I have been attempting powershell but I keep getting errors saying my parameter 'To' is an empty string.
Here is what I've got:
Function Send-MailMessage {
Param (

$EmailFrom = ""
$recipients = @('', '')
$SMTPServer = ""
$SMTPMessage = New-Object System.Net.Mail.MailMessage($EmailFrom,$EmailTo,$Subject,$Body)
$Att = New-Object System.Net.Mail.Attachment($Attachment)
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 25)
$SMTPClient.EnableSsl = $true
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential($EmailFrom, $Password);
Remove-Variable -Name SMTPClient
Remove-Variable -Name Password

} #End
Send-MailMessage -To $recipients -Subject "Subject" -SmtpServer $SMTPServer -From $EmailFrom -Attachment "c:\abc.txt"

Send-MailMessage : Cannot bind argument to parameter 'To' because it is an empty string.
+ Send-MailMessage -To $recipients -Subject "Subject" -Smt ...
+                      ~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Send-MailMessage], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Send-MailMessage
Brian SandtSystems AdministratorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

There's some fundamental thinking errors here. Take the function away first, and then read what you have left.
You will see that $recipients  as well as the other variables are totally NOT DEFINED.
So define it first.

Now from the other perspective, take only the function.
And you'll see you have fixed recipients (and fixed smtp server, etc). Changed it to $To, so that it takes the recipients from your function variable.

And finally, you probably want it to loop through $recipients, so have a for each loop.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Shaun VermaakTechnical SpecialistCommented:
Without Set-StrictMode defining is not required
strict.pngYou do not want to loop recipients because that will generate multiple emails instead of one
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.