First you need to create a new instance of the object in a variable:
$mail= New-Object Net.Mail.SmtpClient("IPorDNSofSmtpServer")
Then, you can send the message:
$mail.Send("FromAddress","Recipient1,Recipent2","Subject","Body")
In most cases, you would use variables to define the addresses, subject, and body of the message.
Some potentially useful documentation:
No comments:
Post a Comment