Question: Can anyone help me out, we need to send mail through command line from Window server. We cannot use Blat as per security issue and neither do we want to install Exchange resource kit. We have our own Mail exchange server we can make use of it.

May be if any batch which could be run to access our SMTP mail server.

Thanks in advance.

Answer: 
I got this resolved without using any SMTP clients. I used Windows Powershell script to send mail and it is working very well. 

Please check the below link 

<http://blogs.msdn.com/b/powershell/archive/2009/10/30/sending-automated-emails-with-send-mailmessage-convertto-html-and-the-powershellpack-s-taskscheduler-module.aspx>

Happy coding !!
HowToGeek demonstrates a Windows PowerShell script that works very well at [How To Send Email From the Command Line in Windows Without Extra Software](http://www.howtogeek.com/120011/stupid-geek-tricks-how-to-send-email-from-the-command-line-in-windows-without-extra-software/)

Here is the method:
First you're defining the variables:

> 
> $EmailFrom = “yourMail@gmail.com”  
> 
>  $EmailTo = “theRecipient'sAddress@someServer.com”  
> 
>  $Subject = “your subject”  
> 
>  $Body = “some text”  
> 
>  $SMTPServer = “smtp.gmail.com”  
> 
>  $SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)  
> 
>  $SMTPClient.EnableSsl = $true  
> 
>  $SMTPClient.Credentials = New-Object System.Net.NetworkCredential(“yourGmailUsername”, “password”);
> 
> 
> 

Then, you're using this command to send the mail:

> 
> $SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)
> 
> 
> 

You'll need a valid Gmail account in order to authenticate as a Gmail user.