How can I send a mail message from the command line?

John Savill

April 6, 2000

1 Min Read
ITPro Today logo in a gray background | ITPro Today

A. You need to use the MAPISEND.EXE utility that issupplied with the Exchange Resource kit. The component you are interestedin is the admin part.

Copy the MAPISEND.EXE from the restored path(i386adminmapisend) to an area of your choice. The usage is simple aslong as the exchange client is installed on the computer already (outlookis also OK).

mapisend -u "" -p -r -s "" -t
e.g. mapisend -u "john savill" -p anything [email protected] -s "Test message" -t c:messagemail4.txt

This is just an example usage, and you may not be sure what you profilename is so instead of using -u and -p, use just -i and this allowsinteractive login and will also allow you to create aprofile 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 ';' andmust 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 the mail 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 beenclosed in quotes.

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like