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 !!
a very nice solution I found generically good if **no authentication** is involved and **no programs can/should be installed or can be assumed to exist** is the following, which should work on Ubuntu and other Linux platforms alike (you can put everything in one line using the `;` command delimiter and removing the `\` chars in the `echo` quoted string):

```
set sender="<sender@example.com>"
set recipient="<recipient@example.com>"
set subj="testsubj"
set body="testbody"
set srv="mysmtpsrv.com"
set port="25"
set crlf="\x0D\x0A"

echo "EHLO man${crlf}\
MAIL FROM: ${sender}${crlf}\
RCPT TO: ${recipient}${crlf}\
data${crlf}\
Subject: ${subj}${crlf}${crlf}\
${body}\
${crlf}.${crlf}"\
|\
nc -Ci 1 ${srv} ${port}

```

(Using like this make sure you are saving the file in Unix style (only a `\x0A` character will be added after the `echo "...\` backslashes).
Otherwise just remove the backslashes and the newline which puts everything on a line and makes it work, but less visually structured.)