How i send an email using batch?????
Moderator: DosItHelp
How i send an email using batch?????
Can you help me and teach me how to send an email on batch????
-
- Expert
- Posts: 391
- Joined: 19 Mar 2009 08:47
- Location: Iowa
-
- Posts: 2
- Joined: 23 Aug 2009 21:28
- Location: India
- Contact:
You can try Arachne for DOS? http://www.glennmcc.org/
Good luck
edit:
While googleing I found this from http://www.paulsadowski.com/WSH/cmdmail.htm :
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