Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 231854

Re: Powershell/PowerCLI Dynamic Email Message Body with Datastores

$
0
0

You use the $msg variable to build your .NET mail send object -> $msg = new-object Net.Mail.MailMessage Your declare the object with a wrong "method" This is more something like $emailFrom = somemail@bloh.com # $smtp.Send($msg) Before using this you have to declare this object $emailSmtpServer = "exchange" $emailSmtpServerPort = "587" $SMTP= New-Object System.Net.Mail.SmtpClient( $emailSmtpServer , $emailSmtpServerPort ) And if there are credentials required... $emailSmtpUser = "username" $emailSmtpPass = "password" $SMTPClient.Credentials = New-Object System.Net.NetworkCredential( $emailSmtpUser , $emailSmtpPass );


Viewing all articles
Browse latest Browse all 231854

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>