Results 1 to 5 of 5

Thread: sendmail in command line

  1. #1
    Join Date
    Jul 2009
    Posts
    19

    sendmail in command line

    I am new to linux and sendmail. Is there a way to use sendmail in command line? This may be useful.. Thanks

  2. #2
    Join Date
    Mar 2009
    Posts
    599

    Re: sendmail in command line

    You want to send the mails using sendmail from command prompt or you want to read it from command prompt? Or you want to create a bash script to automate sending mails? Please specify the above detail, may be i could help...

  3. #3
    Join Date
    Jul 2009
    Posts
    19

    Re: sendmail in command line

    I wanted to learn the syntax for the sending and reading mail so that i could create a bash script for the same. I asked for commands and syntax as i wanted to learn from scratch. But if you could provide me with the bash script, i will try to learn it from there too. Thanks...

  4. #4
    Join Date
    May 2008
    Posts
    4,085

    Re: sendmail in command line

    The sendmail command syntax and usage :

    sendmail [-ba] [-bD] [-bd] [-bi] [-bm] [-bp] [-bs] [-bt] [-bv] [-B type] [-C file] [-d X] [-F fullname] [-f name] [-h N] [-M xvalue] [-Nnotifications] [-n] [-Ooption=value] [-o xvalue] [-p protocol] [-q [ time ]] [-q Xstring] [-R ret] [-r name] [-t] [-V envid] [-v] [-X logfile] [address]
    -ba
    Go into ARPANET mode. All input lines must end with a RETURN-LINEFEED, and all messages will be generated with a RETURN-LINEFEED at the end. Also, the From: and Sender: fields are examined for the name of the sender.

    -bD
    Run as a daemon in the foreground, waiting for incoming SMTP connections.

    -bd
    Run as a daemon in the background, waiting for incoming SMTP connections.

    -bi Initialize the aliases database. Root must own and have exclusive write permission to the /etc/mail/aliases* files for successful use of this option.

    -bm
    Deliver mail in the usual way (default).

    -bp
    Print a summary of the mail queue.

    -bt
    Run in address test mode. This mode reads addresses and shows the steps in parsing; it is used for debugging configuration tables.

    -bs
    Use the SMTP protocol as described in RFC 821. This flag implies all the operations of the -ba flag that are compatible with SMTP.

    -bt
    Run in address test mode. This mode reads addresses and shows the steps in parsing; it is used for debugging configuration tables.

    -bv
    Verify names only; do not try to collect or deliver a message. Verify mode is normally used for validating users or mailing lists.

    -B type
    Indicate body type (7BIT or 8BITMIME).

    -C file
    Use alternate configuration file.

    -d X
    Set debugging value to X.

    -F fullname
    Set the full name of the sender.

    -f name
    Sets the name of the "from" person (that is, the sender of the mail).

    -h N
    Set the hop count to N. The hop count is incremented every time the mail is processed. When it reaches a limit, the mail is returned with an error message, the victim of an aliasing loop.

    -M xvalue
    Set macro x to the specified value.

    -Nnotifications
    Tag all addresses being sent as wanting the indicated notifications, which consists of the word "NEVER" or a comma-separated list of "SUCCESS", "FAILURE", and "DELAY" for successful delivery, failure and a message that is stuck in a queue somewhere. The default is "FAILURE,DELAY".

    -n
    Do not do aliasing.

    -Ooptions=value
    Set option to the specified value (for long from names). Processing Options are described below.

    -o xvalue
    Set option x to the specified value. Processing Options are described below.

    -p protocol
    Set the sending protocol. The protocol field can be in form protocol:host to set both the sending protocol and the sending host. For example: -pUUCP:uunet sets the sending protocol to UUCP and the sending host to uunet. (Some existing programs use -oM to set the r and s macros; this is equivalent to using -p).

    -q [time]
    Process saved messages in the queue at given intervals. If time is omitted, process the queue once. time is given as a tagged number, with s being seconds, m being minutes, h being hours, d being days, and w being weeks. For example, -q2h27m or -q70m would both set the timeout to one hour thirty minutes.

    -q Xstring
    Run the queue once, limiting the jobs to those matching Xstring. The key letter X can be:

    S to limit based on sender.
    I to limit based on queue identifier.
    R to limit based on recipient.
    A particular queued job is accepted if one of the corresponding addresses contains the indicated string.

    -R ret
    Identify the information you want returned if the message bounces; ret can be "HDRS" for headers only or "FULL" for headers plus body.

    -r name
    An alternate and obsolete form of the -f flag.

    -t
    Read message for recipients. To:, Cc:, and Bcc: lines will be scanned for people to send to. The Bcc: line will be deleted before transmission. Any addresses in the argument list will be suppressed. The NoRecipientAction Processing Option can be used to change the behavior when no legal recipients are included in the message.

    -V envid
    The indicated envid is passed with the envelope of the message and returned if the message bounces.

    -v
    Go into verbose mode. Alias expansions will be announced.

    -X logfile
    Log all traffic in and out of sendmail in the specified logfile for debugging mailer problems. This produces a lot of data very quickly and should be used only if necessary.

    address
    The address of the recipient whom you want to send the mail.

  5. #5
    Join Date
    Jul 2009
    Posts
    19

    Re: sendmail in command line

    Thanks for the useful prompt. I tried out some option and was successful. Have bookmarked this page and keep on trying different sendmail command line option. sorry for late reply. Thanks Again!

Similar Threads

  1. xcopy command line together with wmplayer command line
    By Aislinn in forum Operating Systems
    Replies: 5
    Last Post: 31-03-2010, 12:13 PM
  2. Replies: 3
    Last Post: 03-09-2009, 05:41 PM
  3. Command Line Ren (Rename) command broken?
    By SixSigmaGuy in forum Vista Help
    Replies: 2
    Last Post: 18-05-2008, 03:30 PM
  4. Run MSI from Command Line
    By Thomas M. in forum Windows Security
    Replies: 2
    Last Post: 03-11-2007, 03:49 AM
  5. Replies: 1
    Last Post: 18-05-2007, 01:24 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,111,172.62022 seconds with 16 queries