01-26-2009
This should work for you if I understood your question:
#!/bin/ksh
for DATAFILE in `ls *data.txt`
do
FILE=`ls $DATAFILE | awk -F_ '{print $1"_"$2}'`
if [ -s $FILE*"mailids.txt" ]
then
for MAIL in `cat $FILE*"mailids.txt"`
do
mail -s "Put Subject Here" $MAIL < $DATAFILE
done
fi
done
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all,
I am a newbie to unix.
I need to send an email with an attachment in unix to some id like abc@some_company.com
Code i have used is
------------Code---------------------------
#!/bin/ksh
set -x
#set -n
#cript: unix_mail_withattachments.ksh
# Aurthor: Ravin Maharaj
#... (1 Reply)
Discussion started by: samuelc
1 Replies
2. Shell Programming and Scripting
Hi
I tried reading docs from this forum and googled it...but i couldnt get the answer for attaching a document in mail.
I need it to be the actual attachement not adding the content of the file to the body of the mail..
i used uuencode ...to encode the file but it is coming as a junk... (4 Replies)
Discussion started by: aemunathan
4 Replies
3. Shell Programming and Scripting
Hi ,
I am using the below code to send mail through a script which run as a cron job.
msgdate=`date +"%a, %e %Y %T %z"`
daemail=$(cat <<!
From: $from
To: $emailtarget
Subject: $subject
Mime-Version: 1.0
Content-Type: multipart/mixed;
Content-Disposition: inline
$priority
$CONTENT
!)... (2 Replies)
Discussion started by: ahamed
2 Replies
4. Shell Programming and Scripting
I need help with writing a shell script for writing data from a table into a .csv file and send the file has email attachment.
I stuck up with attaching the file to the email.
Thanks, (1 Reply)
Discussion started by: Beena
1 Replies
5. Shell Programming and Scripting
Hi,
In the shell script, i want to do sftp and go to a directory and check if a particular file is present, if not i send an email with some error message. Please guide me about how i could achieve it...." (1 Reply)
Discussion started by: sJohn
1 Replies
6. Shell Programming and Scripting
The file is located under appl/batchdata/
file name: storesales.txt
I am using following code because uuencode is not present. I am not getting the data in file but i am getting the blank file with same name as an email attachment.
( echo "from: sch@xxxx.com"
echo "to:sch@xxxx.com"
echo... (2 Replies)
Discussion started by: skatpally
2 Replies
7. Shell Programming and Scripting
Hi,
We have a requirement to send multiple attachment(pdf and csv) along with html content in a single mail. For that we are using uuencode. It is working for single pdf attachment and html content. But we are unable to send both pdf and csv attachment with html content. Below is the script.... (5 Replies)
Discussion started by: dholea
5 Replies
8. UNIX for Dummies Questions & Answers
i need to send an email to users on the files being loaded...how can i achieve this?
say, my source file directory has 2 files
file1.txt
file2.txt
I just want to send an email saying these files were loaded...Please help (1 Reply)
Discussion started by: saggiboy10
1 Replies
9. Shell Programming and Scripting
Hi i am trying to send a csv file as an attachment via mail from linux.
i am using the below script.
echo "X-Mailer: htmlmail" $VERSION
echo "Mime-Version: 1.0"
echo 'Content-Type: multipart/mixed; boundary="-q1w2e3r4t5"'
echo '---q1w2e3r4t5'
echo "Content-Type: text/html; charset=US-ASCII"... (1 Reply)
Discussion started by: mohanalakshmi
1 Replies
10. Shell Programming and Scripting
I am having an issue sending a text file as an attachment. It is an oracle sql report generated as text. The file is formatted fine. However, when it is emailed and opened in notepad it is missing new lines and not not formatted properly. It is on solaris 10. Here is my code:
#! /bin/ksh... (1 Reply)
Discussion started by: mrn6430
1 Replies
LEARN ABOUT DEBIAN
email::sender::transport::test
Email::Sender::Transport::Test(3pm) User Contributed Perl Documentation Email::Sender::Transport::Test(3pm)
NAME
Email::Sender::Transport::Test - deliver mail in memory for testing
VERSION
version 0.110005
DESCRIPTION
This transport is meant for testing email deliveries in memory. It will store a record of any delivery made so that they can be inspected
afterward.
ATTRIBUTES
deliveries
By default, the Test transport will not allow partial success and will always succeed. It can be made to fail predictably, however, if it
is extended and its "recipient_failure" or "delivery_failure" methods are overridden. These methods are called as follows:
$self->delivery_failure($email, $envelope);
$self->recipient_failure($to);
If they return true, the sending will fail. If the transport was created with a true "allow_partial_success" attribute, recipient failures
can cause partial success to be returned.
For more flexible failure modes, you can override more aggressively or can use Email::Sender::Transport::Failable.
This attribute stores an arrayref of all the deliveries made via the transport. It can be emptied by calling "clear_deliveries".
Each delivery is a hashref, in the following format:
{
email => $email,
envelope => $envelope,
successes => @ok_rcpts,
failures => @failures,
}
Both successful and failed deliveries are stored.
AUTHOR
Ricardo Signes <rjbs@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Ricardo Signes.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-03-06 Email::Sender::Transport::Test(3pm)