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

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
rfpd
Posts: 78
Joined: 06 Jul 2009 16:19
Location: Lisbon, Portugal
Contact:

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

#1 Post by rfpd » 31 Jul 2009 12:14

Can you help me and teach me how to send an email on batch????

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

#2 Post by avery_larry » 03 Aug 2009 13:40

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.

scorpiontus
Posts: 2
Joined: 23 Aug 2009 21:28
Location: India
Contact:

#3 Post by scorpiontus » 23 Aug 2009 21:37

blat could also be helpful

kpropell
Posts: 14
Joined: 24 Aug 2009 10:11

#4 Post by kpropell » 24 Aug 2009 11:17

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

Post Reply