Using Sendmail (& attachment)


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Using Sendmail (& attachment)
Prev   Next
# 1  
Old 01-15-2009
Using Sendmail (& attachment)

Hi,
This is my first thread.
Iam trying the following:
OS: Sun
Database: DB2, Informix, Oracle

* Get the status of the database (using database command line options)
* pipe to a text file
* send mail of the text file to receiptents.

TODO1:
First step i tried to send a test message.
sendmail myname@domain.com
This is test message (ctrl-d)

But when i check my mail box, i did not receive any message.
Where am i wrong? Any settings need to be done?

TODO2:
I have written a small shell script to get the status of the database (informix) and pipe it to a text file

something like:
onstat -d > track.txt

So the file "track.txt" will have the output of the database status.
I will be running this shell script using crontab say every 2 hours or so.

First i would like to add this file track.txt to the sendmail and send it to the receiptents.

Any leads how to add the file?

thanks
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with attachment in sendmail

Hi Folks I have below code, which is able to successfully send the content of the output file as html which is body, but i did tried uuencode & mailx -a for sending attachments but to no avail. cat - ${Output_File} <<EOF| /usr/sbin/sendmail -oi -t #From: ${MAILFROM} To: ${MAILTO} Subject:... (5 Replies)
Discussion started by: nikhil jain
5 Replies

2. Shell Programming and Scripting

Sendmail with attachment

Hello people, I only have sendmail and uuencode on a Oracle (RH) linux server. While: /usr/bin/uuencode awr.html awr.html | /usr/sbin/sendmail myemail@company.com Is working fine, the ideal for me is to do something like: echo "To: me@company.com" > /home/vasilis/msg.txt echo "Subject: DB... (3 Replies)
Discussion started by: drbiloukos
3 Replies

3. Shell Programming and Scripting

Send attachment through sendmail

Hi, I am trying to send log file of a job run in unix machince through sendmail.Though I am able to send the text but it is not sending as attachment. Could you please look into the code and let me know where I have gone wrong fdate=`date %Y%j`... (2 Replies)
Discussion started by: Rossdba
2 Replies

4. Shell Programming and Scripting

sendmail with attachment not working

dear all I have below function which send an email, but if I need to add an attachement it won't work instead it write some jibberish to body of the email begin 644 SIGN_OFF_AP_20120626.csv M4TE'3E]/1D9?4TA%150L351-7T1!5$4L0D]/2RQ35$%455,L5D%25%E012Q# %3U5.5`H` ` end function... (6 Replies)
Discussion started by: manas_ranjan
6 Replies

5. Shell Programming and Scripting

Sendmail with HTML body and attachment

I have an HTML file I am currently sending in the body of an email. I now have a need to send a csv attachment along with it. I can ONLY use sendmail as mutt and xmail etc are not on the server. Here is what I am currently using: It is possible to add code to add an attachment ??!? { ... (8 Replies)
Discussion started by: atelford
8 Replies

6. UNIX for Advanced & Expert Users

Sendmail with attachment command line ?

hi.. Could somebody guide me how to send mail with attachment using sendmail command in unix ? Thank you, (2 Replies)
Discussion started by: bh_hensem
2 Replies

7. Shell Programming and Scripting

sendmail attachment issue

Hi All,, After long time, might be this is nth time post on this forum for the same query...but i tried browsing for sometime and i did not get what i wanted :) i have following syntax in my shell scripting.. (cat filename.txt uuencode attachment attachment)|/usr/lib/sendmail -t... (4 Replies)
Discussion started by: Shahul
4 Replies

8. UNIX for Dummies Questions & Answers

sendmail attachment problem

Hello, i am sending email with following command. The problem is the attachment is displayed as inline text instead of a file attached to email. What should i do? I don't have chance to install new binaries to the server (SunOS) ( \ echo From: Sender ; \ echo Subject: Testing ; \... (1 Reply)
Discussion started by: yakari
1 Replies

9. Solaris

attachment using sendmail

Hi, I use the sendmail command to send automatic e-mail in my control programs, but I'd like to know if there's a non interactive way to send an attachment, like a small text file through sendmail command. I didn't find a way in the man, so anyone has already done it?.. give an example for the... (4 Replies)
Discussion started by: vastare
4 Replies
Login or Register to Ask a Question
VACATION(1)						      General Commands Manual						       VACATION(1)

NAME
vacation - E-mail auto-responder SYNOPSIS
vacation [-a alias] [-C cffile] [-d] [-f database] [-i] [-I] [-j] [-l] [-m message] [-R returnaddr] [-r interval] [-s address] [-t time] [-U] [-x] [-z] login DESCRIPTION
Vacation returns a message, ~/.vacation.msg by default, to the sender informing them that you are currently not reading your mail. The message is only sent to each sender once per reply interval (see -r below). The intended use is in a .forward file. For example, your .forward file might have: eric, "|/usr/bin/vacation -a allman eric" which would send messages to you (assuming your login name was eric) and reply to any messages for ``eric'' or ``allman''. Available options: -a alias Handle messages for alias in the same manner as those received for the user's login name. -C cfpath Specify pathname of the sendmail configuration file. This option is ignored if -U is specified. This option defaults to the stan- dard sendmail configuration file, located at /etc/mail/sendmail.cf on most systems. -d Send error/debug messages to stderr instead of syslog. Otherwise, fatal errors, such as calling vacation with incorrect arguments, or with non-existent logins, are logged in the system log file, using syslog(8). This should only be used on the command line, not in your .forward file. -f filename Use filename as name of the database instead of ~/.vacation.db or ~/.vacation.{dir,pag}. Unless the filename starts with / it is relative to ~. -i Initialize the vacation database files. It should be used before you modify your .forward file. This should only be used on the command line, not in your .forward file. -I Same as -i (for backwards compatibility). This should only be used on the command line, not in your .forward file. -j Respond to the message regardless of whether the login is listed as a recipient for the message. Do not use this flag unless you are sure of the consequences. For example, this will cause to reply to mailing list messages which may result in removing you from the list. -l List the content of the vacation database file including the address and the associated time of the last auto-response to that address. This should only be used on the command line, not in your .forward file. -m filename Use filename as name of the file containing the message to send instead of ~/.vacation.msg. Unless the filename starts with / it is relative to ~. -R returnaddr Set the reply envelope sender address -r interval Set the reply interval to interval days. The default is one week. An interval of ``0'' or ``infinite'' (actually, any non-numeric character) will never send more than one reply. The -r option should only be used when the vacation database is initialized (see -i above). -s address Use address instead of the incoming message sender address on the From line as the recipient for the vacation message. -t time Ignored, available only for compatibility with Sun's vacation program. -U Do not attempt to lookup login in the password file. The -f and -m options must be used to specify the database and message file since there is no home directory for the default settings for these options. -x Reads an exclusion list from stdin (one address per line). Mails coming from an address in this exclusion list won't get a reply by vacation. It is possible to exclude complete domains by specifying ``@domain'' as element of the exclusion list. This should only be used on the command line, not in your .forward file. -z Set the sender of the vacation message to ``<>'' instead of the user. This probably violates the RFCs since vacation messages are not required by a standards-track RFC to have a null reverse-path. Vacation reads the first line from the standard input for a UNIX ``From'' line to determine the sender. Sendmail(8) includes this ``From'' line automatically. No message will be sent unless login (or an alias supplied using the -a option) is part of either the ``To:'' or ``Cc:'' headers of the mail. No messages from ``???-REQUEST'', ``???-RELAY'', ``???-OWNER'', ``OWNER-???'', ``Postmaster'', ``UUCP'', ``MAILER'', or ``MAILER- DAEMON'' will be replied to (where these strings are case insensitive) nor is a notification sent if a ``Precedence: bulk'' or ``Prece- dence: junk'' line is included in the mail headers. The people who have sent you messages are maintained as a db(3) or dbm(3) database in the file .vacation.db or .vacation.{dir,pag} in your home directory. Vacation expects a file .vacation.msg, in your home directory, containing a message to be sent back to each sender. It should be an entire message (including headers). For example, it might contain: From: eric@CS.Berkeley.EDU (Eric Allman) Subject: I am on vacation Delivered-By-The-Graces-Of: The Vacation program Precedence: bulk I am on vacation until July 22. If you have something urgent, please contact Keith Bostic <bostic@CS.Berkeley.EDU>. --eric FILES
~/.vacation.db default database file for db(3) ~/.vacation.{dir,pag} default database file for dbm(3) ~/.vacation.msg default message to send SEE ALSO
sendmail(8), syslog(8) HISTORY
The vacation command appeared in 4.3BSD. $Date: 2013-11-22 20:52:02 $ VACATION(1)