I am using the script i got at this link - http://communities.vmware.com/docs/DOC-6980
But it is not sending email.....
I am getting this error
Exception calling "Send" with "1" argument(s): "Failure sending mail."
At D:\Documents and Settings\belema\Desktop\New Folder\snapshots.ps1:64 char:18
+ $SmtpClient.Send <<<< ($MailMessage)}
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErroId : DotNetMethodException
Is it neccessary that the machine from which i am running this script to be in same domain of ESXi or vCenter host ??
Please suggest if any modification are required in that script as that script is way back from 2008.
Or the machine from which i am running report and exchange server should be in same domain ???
There is no requirement to be in the same AD domain afaik.
Can you reach the SMTP server from the station where you are running the script ?
Does
telnet smtp.server 25
return anything ?
Btw, if you are in the correct PowerShell version (v2 and up), it is much easier to use the Send-MailMessage cmdlet.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I get error
"Could not open connection to the host Port 25 : Connect Failed"
i think thats where the issue is. ?
I suspect so, talk to your email admin (if it is not you), and ask him if the SMTP server accepts connections from your station.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference