Email in Ksh using elm


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Email in Ksh using elm
# 1  
Old 12-05-2005
Question Email in Ksh using elm

I have a txt file which contains the following details.

email address date other
email address date other

from this i want to take each email address and send mail with a message and put the date in the message ( in some specific place ).

need to send mails one by one marking a copy to myself.

please help

The script is given below what i have developed. But this will only let me send the mail to all the people in the same time.

i belive a for loop can do this for me. Please help me.

TXTFILEFR="a.out"
TXTSIGN="signature2.txt"

DIRECTO="/opt/var/"
SQLDIRECTO="/opt/var/so"
SUBJECT="Your attachment"
A="a.b@log.com"
export ORACLE_SID=sid

for user in $(cut -d: -f3 a.out)
do
echo $user
echo "Hello, \n" > ${DIRECTO}/mail.out

echo "\n message1.\n" >> ${DIRECTO}/mail.out
echo "\message2.:\n" >> ${DIRECTO}/mail.out
echo "\n mesg3.:\n" >> ${DIRECTO}/mail.out

cat ${DIRECTO}/${TXTSIGN}>> ${DIRECTO}/mail.out
${DIRECTO}/mail.out

elm -s " subject line " -b $user < ${DIRECTO}/mail.out

done

Last edited by srikanth78; 12-05-2005 at 05:18 AM..
# 2  
Old 12-06-2005
>> But this will only let me send the mail to all the people in the same time.

hmm, I dont get you, do you intend to send the mail with different time stamps ?
or do you intend to use the date field from the text file to be part of the email body ?
# 3  
Old 12-07-2005
Data

What i am trying to do is to send mail to all the email addresses in the text file at the same time. But i want to put all the email addresses in the bcc field so that the people do not see each others addresses.
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[Solved] adding email option to KSH

Hi, I wanted to add a email option to this script. and was wondering if anyone could help me out. #!/bin/ksh echo "Finding hdisk" <DIR>/find-disk i=1 b=0 p=0 while ... (2 Replies)
Discussion started by: vpundit
2 Replies

2. Shell Programming and Scripting

KSH script to run other ksh scripts and output it to a file and/or email

Hi I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email. For example ------- Script ABC ------- a.ksh b.ksh c.ksh I need to call all three scripts execute them and... (2 Replies)
Discussion started by: pacifican
2 Replies

3. Shell Programming and Scripting

sending email from a ksh script

hi all, i have a ksh script which is meant to send an email with an attachment. i use the following command to send email /usr/bin/uuencode $logFn $logFn | /usr/bin/mail -s "restoration results" $EMAILTO; where '$logFn' is the name of the file including the full path e.g... (0 Replies)
Discussion started by: cesarNZ
0 Replies

4. Shell Programming and Scripting

sending email from KSH unix script.

Hi Need guidance on including code to mail a couple of files atached with some subject and mail body !!.. Thanks in advance (3 Replies)
Discussion started by: rosh0623
3 Replies

5. UNIX for Dummies Questions & Answers

Mailx and Elm

I am trying to send mail from Unix (HP9000) to Exchange mail system. I need to send the file as an attachment. I am using uuencode to encode file as ASCII, but can't seem to get to over to Exchange as an attachment. I have tried both elm and mailx. I know I've done this before, but can't remember... (4 Replies)
Discussion started by:
4 Replies
Login or Register to Ask a Question