script to send mail from unix??
I wrote a shell script to send a mail, it is not showing any errors but i didn't receive any mail
echo 'In script'
echo "$subject" | sed 's/~/ /g' | read sub
echo '\nMail List'
echo "$body_of_email" | sed 's/~/ /g' | read body
(echo "$body";echo '\n';cat U.CUE_CPM )| mailx -s "$sub" -r some_address@some_mail.com "$to_list"
if [ $? -eq 0 ]
echo "Mail is Sent"
echo "Mail is not sent(In script)"
$ send_mail.ksh hi test some_address@some_mail.com
Mail is Sent
can any one please help me what is wrong in my script.
Last edited by blowtorch; 07-12-2007 at 05:39 AM.. Reason: remove email address
I tested your script several times and it worked every time,
except when I placed the wrong e-mail address either in the
receiver or with the '-r' option.
Make sure your e-mail addresses are correct.
can anybody pls help me in writing a shell script to send a automatic email to a team if the mount point size increases to 70mb. for example consider /u01 mount point in a linux platform using bash shell. pls do help.
#TO send email
#regarding disk space
for addr in $TO_ADDR
echo "From: $FROM_ADDR" > $CUR_DIR/mail.txt
echo "To: $TO_ADDR" >> $CUR_DIR/mail.txt
echo "Subject: Sending email">> $CUR_DIR/mail.txt
# here you can implement your logic to check the size of the folder
# redirect it to a mail.txt
echo "" >> $CUR_DIR/espmail.txt
echo "This is a automated email.Please don't reply to it ." >>$CUR_DIR/mail.txt
sendmail $addr < $CUR_DIR/espmail.txt
Note : Please change the CUR_DIR , FROM_ADDR & TO_ADDR as per your need . You can have multiple sender email ids seperated by a space in TO_ADDR .
Last edited by sakthifire; 08-21-2008 at 04:52 AM..
|Thread Tools||Search this Thread|
|More UNIX and Linux Forum Topics You Might Find Helpful|
|Thread||Thread Starter||Forum||Replies||Last Post|
|how to run a script using cron job and send the output as attachment via e-mail using unix||vidhyaS||Shell Programming and Scripting||8||06-09-2011 02:20 AM|
|unix script to check if rsh to box and send status mail||bpm12||UNIX for Dummies Questions & Answers||1||10-09-2008 07:41 AM|
|Req the mail send from unix script||Balamani||UNIX for Dummies Questions & Answers||1||07-14-2008 08:02 AM|
|Script to send a mail in UNIX||sudhi||Shell Programming and Scripting||1||11-28-2006 06:53 AM|
|can not send mail from unix server to company/yahoo mail||b5fnpct||UNIX for Dummies Questions & Answers||5||11-22-2002 08:24 PM|