Go Back   TechArena Community > Software > Operating Systems
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: ,

Sponsored Links



sendmail in command line

Operating Systems


Reply
 
Thread Tools Search this Thread
  #1  
Old 10-08-2009
Member
 
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
Reply With Quote
  #2  
Old 10-08-2009
Member
 
Join Date: Mar 2009
Posts: 600
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...
Reply With Quote
  #3  
Old 10-08-2009
Member
 
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...
Reply With Quote
  #4  
Old 10-08-2009
Solomon's Avatar
Member
 
Join Date: May 2008
Posts: 4,056
Re: sendmail in command line

The sendmail command syntax and usage :

Quote:
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.
Reply With Quote
  #5  
Old 15-09-2009
Member
 
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!
Reply With Quote
Reply

  TechArena Community > Software > Operating Systems


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "sendmail in command line"
Thread Thread Starter Forum Replies Last Post
xcopy command line together with wmplayer command line Aislinn Operating Systems 5 31-03-2010 01:13 PM
PROBLEM: COMMAND LINE OPTION SYNTAX ERROR. TYPE COMMAND /? FOR HEL FORTHELOVEOFGODPLEASEHELPME MediaCenter 3 03-09-2009 06:41 PM
Command Line Ren (Rename) command broken? SixSigmaGuy Vista Help 2 18-05-2008 04:30 PM
Run MSI from Command Line Thomas M. Windows Security 2 03-11-2007 04:49 AM
autorun.inf - shell\..\command with command line parameter doesn'twork kakii Windows XP Support 1 18-05-2007 02:24 AM


All times are GMT +5.5. The time now is 12:46 AM.