Microsoft – PowerShell – Net.Mail.SmtpClient – Send – Error Message – Exception Calling Send
Who needs therapy when you one can just talk to oneself and call it a Blog.
I guess that is what programmer’s call Introspection…..
Need a quick email notification and so googled for one and downloaded it over the .Net
It is actually nice and clean.
But, as I used it kept getting this error message:
Exception calling "Send" with "1" argument(s): "failure sending mail." At ......ps1:#### char:## + $smtp: send <<<< ($mailMessage) + CategoryInfo : NotSpecified: (:) , MethodInvocationException + FullyQualifiedErrorId : DotNetMethodException
The more I looked a the line of code, it looked OK. But, the error message seemed a big big.
And, so I printed out my data.
The problem ended up being that rather than having the actual smtp server, I had the old
Nice one MS. But, it will really be nice to have a little “sanitary code” at the top of
each method. Just a little “assert” code will be nice.