Solved

Batch halp

Posted on 2004-09-04
12
1,072 Views
Last Modified: 2008-01-09
How Can I send A E-mail over A batch file? I can't use outlook because it is corrupt and
"Start mailto:<to>?subject=<subject>^&body=<body>"
Dosent send mail it only writes it.
0
Comment
Question by:shanekelly_7
  • 3
  • 3
  • 2
  • +2
12 Comments
 
LVL 36

Expert Comment

by:Zyloch
ID: 11979311
Hi

You can have a program like this: http://www.exclamationsoft.com/exclamationsoft/netmailbot/default.asp

Then, if you want, you can create a batch file using those commands.

Regards,
Zyloch
0
 
LVL 1

Author Comment

by:shanekelly_7
ID: 11979352
I can't connect to the link, But one of the problems is cant want a batch that will work on all computers on my network (all windows xp) and my network will not allow anyone to download programs.
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 11979373
Hmm, looks like the links isn't working right now--it was before. Creating these sorts of batch files is beyond my experience, so just hang tight and wait for someone :)
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 15

Expert Comment

by:adamdrayer
ID: 11980606
0
 
LVL 1

Author Comment

by:shanekelly_7
ID: 11983531
If you can not login telnet via batch script is there a trick you can do with the URL so that : "Start mailto:<to>?subject=<subject>^&body=<body>" Would make the email, but is there some thing you could do to send it ?
0
 
LVL 15

Expert Comment

by:adamdrayer
ID: 11985244
there very well many be a dos-based smtp program.  But I'm not familiar with any.
0
 

Expert Comment

by:Frater_VI
ID: 12001903
I did some poking around and everything I found referencing a batchfile generated email required the use of an email client such as outlook express or a command line emailer like Blat, GBMailer or Mailsend

Blat can be obtained from http://sourceforge.net/projects/blat
GBMailer can be found here http://www.gboban.com/
Mailsend is here http://www.mailsend-online.com/

Of the three, Blat is the only one that is free.

-Frat
0
 

Accepted Solution

by:
Frater_VI earned 20 total points
ID: 12001949
I found this on another forum  May help this is a copy of someone elses batch file for an application called - osusmtp

@echo off
setlocal
set SMTPSERVER=mail.domain.com
set FROMEMAIL=from@domain.com
set TOEMAIL=to@domain.com
set SUBJECT="Subject line"
set BODYMSG="Test in body "
set MAINDIR=c:\filedir
set COPYDIR=%MAINDIR%

:: Get current date.
for /f "tokens=1-4 delims=/ " %%i in ('date/t') do (

set DATE=%%l%%j%%k)

mkdir %COPYDIR%\%DATE%
xcopy /Y %MAINDIR%\*.* %COPYDIR%\%DATE%

for /f "tokens=1" %%i in ('DIR /A-D /O-D /B c:\filedir') do (set ATTACHMENT=%%i)

mailer.exe /zl %SMTPSERVER% /zt %TOEMAIL% /zf %FROMEMAIL% /zs %SUBJECT% /zb %ATTACHMENT% /zat %ATTACHMENT%;

del %ATTACHMENT%

The Discussion can be found at - http://www.computing.net/dos/wwwboard/forum/13786.html
OSUSMTP can be found here - http://oregonstate.edu/~reeset/html/other/smtp.html

Good Luck

-Frat
0
 
LVL 23

Expert Comment

by:Danny Child
ID: 12018746
bmail has worked well for me:
http://www.beyondlogic.org/solutions/cmdlinemail/cmdlinemail.htm
if you can download it from any pc, you could move it to your network on a floppy

in a batch file:
For /f "Tokens=*" %%a in (EmailAddresses.txt) do cmd /c bmail -s <ExchangeServerName> -t %%a -f <SenderAddress> -h -a "Message Subject" -b "Message Body"

the above is all one line, and sends an email to every address in EmailAddresses.txt
Rreplace anything in < > with the obvious.  

hmmm, why are you sending email from the command line in an environment where you can't do downloads <wink>

0
 

Expert Comment

by:Frater_VI
ID: 12243822
We probably overwhelmed him with too much info :) but whatever you decide will be fine with me.
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12243996
Well, he/she's into some serious scripting: http://www.experts-exchange.com/Operating_Systems/Q_21138103.html
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question