Solved

Batch halp

Posted on 2004-09-04
12
1,083 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
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 Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

623 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