Where or how do you find a IP address for a SmtpServer when you know the smtp server: "smtp.email.com"?
$PlainPassword = "mainpassword" $SecurePassword = $PlainPassword | ConvertTo-SecureString -AsPlainText -Force $Username = "MYSITE\Administrator" $Credentials = New-Object System.Management.Automation.PSCredential -ArgumentList $Username, $SecurePassword $mailprops=@{ Subject = 'This Subject' Body = 'The Body and the subBody' To = 'emailto@mail.com' From = 'emailfrom@email.com' SmtpServer = '???' } Send-MailMessage $mailprops -Credential $Credentials
Error Code:
Unable to connect to remote server.