# email a file through outlook as attachment using batch file



## khanzafarh (Mar 9, 2011)

I am trying to email a file through outlook as attachment using a batch file. I am using following command in the email as mentioned in one of the thread in this forum. 
"C:\Program Files\Microsoft Office\Office11\Outlook.exe" /c ipm.note /m "[email protected]" /a "c:\test.txt"
However, I have following issues:
- How I can add the subject and the message
- The batch file is opeing the Outlook, attaching the file and assigning the email address but is not sending the email.
Any help will be highly apprecaited.


----------



## Squashman (Apr 4, 2003)

Outlook certainly wouldn't be my first choice for sending an automated email from the cmd line. Years ago we used BLAT to do that on Windows.


----------



## khanzafarh (Mar 9, 2011)

However, if we are forced to use Outlook then what is the solution?


----------



## Squashman (Apr 4, 2003)

I don't believe there is one. You either use a different client or right something in VB.net.


----------

