z/OS Communications Server: IP User's Guide and Commands
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


sendmail command—Send file contents

z/OS Communications Server: IP User's Guide and Commands
SC27-3662-00

Purpose

Use the sendmail command to send the contents of a file.

Format

Read syntax diagramSkip visual syntax diagram
>>-sendmail--+-----------+--+---------------------+------------><
             '-user_name-'  '-command_line_switch-'   

Parameters

user_name
The user_name of the person you want to receive the mail.
command_line_switch
See the z/OS Communications Server: IP System Administrator's Commands for information about sendmail command line arguments or switches.

Examples

To test run sendmail by hand, complete the following steps:

  1. Create a file named sendstuff with the following contents:
    This is a one line message.
  2. Mail this file to yourself with the following command line, where you is your login name:
    sendmail you <sendstuff
When you run sendmail, any command-line arguments that do not begin with a hyphen (-) are considered to be the names of the people to whom you are sending the mail message.
Note: The full path name might differ on your system. If so, simply specify the full sendmail path name as it is configured on your system.

The <sendstuff sequence causes the contents of the file that you have created (sendstuff) to be redirected into the sendmail program. The sendmail program treats everything it reads from its standard input (up to the end of the file) as the mail message to transmit.

Results

There are several ways to view the message that you just sent, depending on how your system is configured. You can type MAIL to view your mail, or use the mh package and type INC to receive and SHOW to view your mail. After viewing your mail, save the mail message to a file. The file will look something like this:

From you@Here.US.EDU  Wed Dec 26 18:45:36 2001
 Return-Path: <you>
 Received: (from you@localhost)
    by Here.US.EDU (8.12.1/8.12.1) id fBQAjaoi001037
    for you; Wed, 26 Dec 2001 18:45:36 -0700
 Date: Wed, 26 Dec 2001 18:45:36 -0700
 From: you <you>
 Message-Id: <200112261045.fBQAjaoi001037@Here.US.EDU>
 Status: RO

 This is a one line message.

This file begins with nine lines of text that were not in your original message. Those lines were added by sendmail and your local delivery program and are called the header.

The last line of the file is the original line from your sendstuff file. It is separated from the header by one blank line. The body of a mail message comes after the header and consists of everything that follows the first blank line.

Ordinarily, when you send mail with your MAILUSERAGENT (MUA), the MUA adds a header and feeds both the header and the body to sendmail. This time, however, you ran sendmail directly and supplied only a body; the header was added by sendmail.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2013
This information center is Built on Eclipse™ ( www.eclipse.org ).