Page 1 of 1

How i send an email using batch?????

Posted: 31 Jul 2009 12:14
by rfpd
Can you help me and teach me how to send an email on batch????

Posted: 03 Aug 2009 13:40
by avery_larry
I use a 3rd party command line email program called sendemail. Google it. You might be able to program something directly in DOS using telnet, but probably not worth the effort.

Posted: 23 Aug 2009 21:37
by scorpiontus
blat could also be helpful

Posted: 24 Aug 2009 11:17
by kpropell
You can try Arachne for DOS? http://www.glennmcc.org/

Arachne GPL, internet package for DOS.... Fullscreen graphical WWW browser, HTML viewer, HTML editor, e-mail client.... Arachne supports a subset of HTML/4.0, CSS 1.0, HTTP, FTP, POP3, SMTP


Good luck :)

edit:
While googleing I found this from http://www.paulsadowski.com/WSH/cmdmail.htm :

The sample script below sends an email using IIS's SMTP service running on the local machine.
Notes:
Special shell characters such as < and > must be escaped using the caret character ^
IIS requires only a minimal set of headers followed by a blank line which separates
the header from the body text. To create the blank line use the following line in
your script:
echo.>>%tempmail%
It is critical that there be no extra spaces in that line! Use exactly as shown.

The move command moves the temporary file with the mail into the pickup directory.
The pickup dir is typically c:\inetpub\mailroot\pickup but this may be different on
your system.

The account under which this script runs must have write permission to the
pickup directory. Once the file is sent the server itself deletes the file from
the pickup directory. DO NOT attempt to write the file directly to the pickup
directory. Always move it from a temp directory. IIS will attempt to send
any file in the pickup directory as soon as it detects it. Therefore you may
not have completed writing to the file before IIS tries to send and deletes the file.
Always move the file to the pickup directory.

@echo off & setlocal
:: set the temp file location
set tempmail=%temp%\tempmail.%random%.txt
:: echo the basic headers to the temp file
echo To: "Scripting Test" ^<test@paulsadowski.com^> > %tempmail%
echo From: "Me" ^<me@my.com^> >> %tempmail%
echo Subject: Test2 >> %tempmail%
:: echo the blank line that separates the header from the body text
echo.>>%tempmail%
:: echo the body text to the temp file
echo First line of body text.>> %tempmail%
echo Second line of body text.>> %tempmail%
:: move the temp file to the mail pickup directory
:: adjust this location for your system
move %tempmail% c:\inetpub\mailroot\pickup
set tempmail=
endlocal