![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why no attachment seen??? | Amruta Pitkar | UNIX for Dummies Questions & Answers | 2 | 04-27-2009 06:22 PM |
| sendmail attachment | jayman | Shell Programming and Scripting | 3 | 08-05-2008 02:20 AM |
| attachment using sendmail | vastare | SUN Solaris | 4 | 01-03-2006 12:56 PM |
| How To Add Attachment to Mail | lesstjm | Shell Programming and Scripting | 3 | 12-06-2005 11:24 AM |
| Mailing an attachment | gayath3 | Shell Programming and Scripting | 0 | 03-18-2005 06:09 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 |
|
||||
|
Possible solution to first part
Instead of using 'sendmail', perhaps you want just 'mail'.
Try this and see how far it gets you: # ls > ls.txt # mail -s "ls output" youremail@yourhost < ls.txt Then check your mail. If you're sending to multiple recipients you may want to check to see if your mailer supports lists. Otherwise you'll have to write a script that opens up a file of recipients and loops over them: onstat -d > onstat.txt for r in `cat alertemails.txt` do mail -s "alert email" $r < onstat.txt done I think that will likely do what you want. Good luck. |
|
||||
|
Quote:
Iam now looking at (as you specified) to sending mails to multiple recipitents. 1. If i understood right, i create a "alertemails.txt" which contains the list of emails and use this as per your script? 2. I put this in a script, execute with cron job and its done, right? Also the cron daemon is not running and they (system guys) are looking at it. Once iam done, i shall update. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|