I was trying to send emails through powershell on a computer PC01. and received error message blow
"InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient) [Send-MailMessage], SmtpException"
I also tried to run the same script on another computer PC02 in the same subnet. it worked.
Both PCs can telnet to the smtp server on 25 successfully.
I have also tried to use ISP smtp to send email which was the same result PC01 didn't work with the same error. PC02 worked.
I checked the even log, no outstanding errors or warnings found.
I have also tried to turned off firewall and antivirus program without luck (which shouldn't be the issue as I can telnet to port 25 on the smtp server)