I can use some other tools to send emails (like http://glob.com.au/sendmail/ for example), but for some reason I can't send emails with Net.Mail.SmtpClient.
I am using the same settings as I have configured in my email client (outlook) as well. The vendors server (which I have no access to) uses a different outgoing port (465) and SSL. Currently just trying to send emails to myself.
$CredUser = "me@mydom.com" $CredPassword = "mypass!" $EmailFrom = $CredUser $EmailTo = $CredUser $Subject = "Test mail Subject" $Body = "Test Email Body" $SMTPServer = "www.myemailvendor.biz" $msg = new-object Net.Mail.MailMessage $msg.From = $EmailFrom $msg.to.Add($EmailTo) $msg.Subject = $Subject $msg.Body = $Body $SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 465) $SMTPClient.EnableSsl = $true $SMTPClient.Credentials = New-Object System.Net.NetworkCredential($CredUser, $CredPassword) $SMTPClient.Send($msg)
The error I get is: Exception calling "Send" with "1" argument(s): "The operation has timed out."
How can I troubleshoot this further