Thursday, June 9, 2016

Send email through powershell

 
$smtpserver"your-exchange-server" 
 
$to = "neerajvayu123@gmail.com" 
 
$from = "neerajvayu123@gmail.com" 
 
$subject = "First email"  
 
$body = "HI $to ,
" 
 
$body +"How are you doing, i am testing email function 
" 
  
send-MailMessage -SmtpServer $smtpserver -To $to -From $from -Subject $subject -Body $body -BodyAsHtml

No comments:

Post a Comment

Thanks for showing interest in tech-jockey.

Content of this blog has been moved to GITHUB

Looking at current trends and to make my content more reachable to people, I am moving all the content of my blog https://tech-jockey.blogsp...