Discussion Locked

Mail From Comman Prompt in Nt Server 4.0

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I would like to make a script batch that cleans a directory with log files (no problem for this). I'd like to assign to the file I rotate a date extension (I havent'clue how to do this) and I'd like to transfer a compressed file with the old logs via mail to my mailbox.
There's a system (or command) that allow to send mail from command prompt (like the command mail o mailx under Unix systems)?
Tks in advandce.
Andy

5 replies

by andy bettoni

Tks. Downloaded. I didn't tested becasue the setup process is writing something to my server that i don't like. Reading the notes, I learned how it will function.
Andy

by vagab0nd

You need to use the MAPISEND.EXE utility that is supplied with the Exchange Resource kit. The component you are interested in is the admin part.

Copy the MAPISEND.EXE from the restored path (i386\admin\mapisend) to an area of your choice. The usage is simple as long as the exchange client is installed on the computer already (outlook is also OK).

mapisend -u "" -p -r -s "" -t
e.g. mapisend -u "john savill" -p anything -r john@savilltech.com -s "Test message" -t c:\message\mail4.txt

This is just an example usage, and you may not be sure what you profile name is so instead of using -u and -p, use just -i and this allows interactive login and will also allowyou to create a profile which you can then use in future. The full list of switches are

-u Profile name (user mailbox) of sender
-p Login password
-i Interactive login (prompts for profile and password)
-r Recipient(s) (multiples must be separated by ';' and must not be ambiguous in default address book.)
-c Specifies mail copy list (cc: list)
-s Subject line
-m Specifies contents of the mail message, this is ignored if -t is specified
-t Specifies text file for contents of themail message
-f Path and file name(s) to attach to message
-v Generates an 8 line summary of the sent message

In all cases if the passing parameter is more than one word it should be enclosed in quotes.

by andy bettoni

That's Ok and it works properly. I don't like it so much, because there is a clear password shown in the script in the switch -p.
Tks.
Andy

This discussion is closed to new replies.