Hello,
I have found the following code on the internet:
$SmtpClient = new-object system.net.mail.smtpClient
$SmtpServer = "serveraddresshere.com"
$SmtpClient.host = $SmtpServer
$From = "Testing E-Mail Send mail@mail.com"
$To = mail@mail.com
$Title = "Test Subject"
$Body = "Body Text"
$SmtpClient.Send($from,$to,$title,$Body)
However when I run it I get the error of:
Exception calling "Send" with "4" argument(s): "Failure sending mail."
At line:1 char:17
+ $SmtpClient.Send <<<< ($from,$to,$title,$Body)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
I have tried internet and external server names and I am not getting anywhere I have tried on a client machine and a server however still the same does anyone know whats going on?
Many Thanks
James