# Send e-mail through batch file / command line



## equama (Dec 19, 2003)

Hi. Is anyone aware of an easy way to send an e-mail through a command line?

I have a user that creates a zip file every couple of days which is then sent to me via FTP. The process is done with wzzip.exe through a little batch file that I created.

Since the FTP is not exactly reliable from this client, I would like that same batch file to somehow initiate an e-mail to be sent every time this zip file is created.

That way I know to look for an incoming file through the FTP transfer.

Thanks for your time.

Brian - equama


----------



## coderitr (Oct 12, 2003)

I use a freeware utility called GBMailer. Google for it. It accepts all the parameters from the command line and sends mail through any smtp server.


----------



## mole (Aug 24, 1999)

I'm not familiar with GBMailer, but do advise that many formerly "open" SMTP servers now require authentication. This is to reduce open relaying of SPAM. Some command line mailers do not support or may not work well with SMTP servers requiring authentication. Conversly, not all SMTP servers have authentication properly configured either. "Blat" is another command line mailer that I use.

You could also run your own SMTP server with authentication or IP security set so only you can use it and relay to an authenticated SMTP server. This is complicated, but will do the job.

A nice FTP utility that works very well with batches and other scripts is WebDrive - http://www.southrivertech.com/ It isn't free, but is easier than writing the FTP script from a batch as you can map your FTP server to a drive letter.


----------



## coderitr (Oct 12, 2003)

Good tip mole, thanks.

I don't mean to suggest that I'm a spammer. We (my company) sends a lot of system generated email to our stores. The messages come to my process en-masse as ascii and I parse the file for each individual store and mail it out.


----------



## mole (Aug 24, 1999)

Hi coderitr,

You being a spammer was furthest from my mind. People don't like/want SPAM and it is good the ISPs are locking down their SMTP servers. What often gets overlooked though are the legitimate uses of SMTP servers that were easy to connect to through simple command line mailers. I had to re-write many automatic email scripts I had running to notify me of critical points in scheduled tasks on my home network and the one I tend at work. None of these were SPAM related of course.

Another example of the internet becoming a more complicated place. 

By this time I hope the OP has a solution.

Take care and happy New Year.


----------

