I think the problem is in your function call. You miss a lot of parameters. Take a look on my working gmail example:
$password = ConvertTo-SecureString "123456789" -AsPlainText -Force $emailCredentials = New-Object pscredential ("[email protected]", $password) try { Send-MailMessage -From "[email protected]" -To "[email protected]" -Subject "subject" -Body "body" -SmtpServer "smtp.gmail.com" -Port 587 -Credential $emailCredentials -Encoding UTF8 -UseSsl -ErrorAction Stop } catch { echo $error[0] }
There is no -Credential parameter in your call, and I'm almost sure, that's the problem. Also your smtp server may have this protocol on different port, this is what -Port is for. And finally -UseSsl, if smtp server is encrypting mails, then without this switch, your emails will be not send. -Encoding UTF8 is just for regional chars.
Check your $error[0], it may tell you, where the problem is. Check what is happening on your -From email. On gmail you can see sometimes auto-repiles, with error description.
I'm sorry for not giving you simple solution, but I don't have enough informations, to find it.