Register
It is currently Thu Oct 30, 2014 10:39 am

Problem with this email script.


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Tue Oct 22, 2013 8:28 am   

Joined: Tue Oct 22, 2013 7:59 am
Posts: 1
First ever post - I hope this is the correct place!
This script makes and sends an email with a pdf attachment.
It works but the "body text" ($text) is not shown in the message.

echo "Hello $USER"
echo -e "Enter invoice number: \c "
read number
echo -e "Enter recipient email address: \c "
read email
text="Standard text"

cat /home/life/navi/archive/0000$number.txt | updf -ml50 -mt60 -i/home/life/navi/html/gif/Gbi_head.jpg > jcy10033.pdf

echo $text | umail -u $USER@gondrand.co.uk -s "Copy invoice: $number" -fmime jcy10033.pdf 'To:' $email 'CC:' $USER@gondrand.co.uk

The problem appears to relate to -fmime.
If the attachment is removed the body text is shown.
Is it possible to display "body text" and use -fmime?

Can anyone suggest a solution?

Many thanks


Top
 Profile  
 PostPosted: Tue Oct 22, 2013 11:07 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 550
hi,

this is not a BASH question :(
read harder umail's man page. I don't have this program available on Debian.

you could try to add a dash (-) to that command; it usually stands for standard input.
a bit like this:
Code:
echo "foo bar baz" | cat ./someFile - ./someOtherFile
should print the content of ./someFile, followed by 'foo bar baz', and ./someOtherFile's content.
Code:
echo "$text" | umail  -  -u $USER@gondrand.co.uk -s "Copy invoice: $number" -fmime jcy10033.pdf 'To:' $email 'CC:' $USER@gondrand.co.uk


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP