Sending Multiple Files through email | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Sending Multiple Files through email

Shell Programming and Scripting


Tags
mailx, mailx attachment

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-29-2005
nbvcxzdz nbvcxzdz is offline
Registered User
 
Join Date: Dec 2003
Last Activity: 14 November 2005, 3:43 PM EST
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Sending Multiple Files through email

Hi Everyone,

Iím using the uuencode command with the mail command to send out emails through a UNIX script. The problems is that i have a number of gif files that i need to attach to a single email but the number and name of the gif files is not static. Example today the folder home/Desktop may contain
1.gif
2.gif
3.gif

but tomorrow it may contain
3.gif
sfsdf.gif
vbgcvb.gif

So that only thing that is constant is that all the files have a gif extension. Im trying to use a single line command that will enable me to send all the gif files in the current folder:

uuencode home/Desktop/*.gif "many gif files" | mailx -s "GIf files" me@yahoo.com

does anyone know how to do this? Unfortunately zipping the files before adding them as an attachment is not possible.


Thanks
Sponsored Links
    #2  
Old 03-29-2005
Ygor's Avatar
Ygor Ygor is offline Forum Advisor  
Advisor
 
Join Date: Oct 2003
Last Activity: 21 November 2013, 8:38 AM EST
Location: 54.23, -4.53
Posts: 1,801
Thanks: 1
Thanked 110 Times in 98 Posts
One syntax would be....
Code:
(
   for i in home/Desktop/*.gif
   do 
      uuencode $i $(basename $i) 
   done
) | mailx -s "GIf files" me@yahoo.com

Sponsored Links
    #3  
Old 03-29-2005
nbvcxzdz nbvcxzdz is offline
Registered User
 
Join Date: Dec 2003
Last Activity: 14 November 2005, 3:43 PM EST
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
thanks for your speedy reply...i tried typing the code as a single file and it seems to get the following error:

"Variable syntax"

could you let me know if im doing anything wrong? or is there another way of writing the same line or even another solution.

thanks
    #4  
Old 03-29-2005
nbvcxzdz nbvcxzdz is offline
Registered User
 
Join Date: Dec 2003
Last Activity: 14 November 2005, 3:43 PM EST
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Mail command

Hi Everyone,

I’m using the uuencode command with the mail command to send out emails through a UNIX script. The problems is that i have a number of gif files that i need to attach to a single email but the number and name of the gif files is not static. Example today the folder home/Desktop may contain
1.gif
2.gif
3.gif

but tomorrow it may contain
3.gif
sfsdf.gif
vbgcvb.gif

So that only thing that is constant is that all the files have a gif extension. Im trying to use a single line command that will enable me to send all the gif files in the current folder:

uuencode home/Desktop/*.gif "many gif files" | mailx -s "GIf files" me@yahoo.com

does anyone know how to do this? Unfortunately zipping the files before adding them as an attachment is not possible.


Thanks
Sponsored Links
    #5  
Old 03-29-2005
RTM's Avatar
RTM RTM is offline Forum Advisor  
Registered User
 
Join Date: Apr 2002
Last Activity: 3 April 2014, 2:50 PM EDT
Location: On my motorcycle
Posts: 3,092
Thanks: 1
Thanked 29 Times in 9 Posts
Merged multiple threads - please read the rules - especially about double posting.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Zipping files and sending email win4luv UNIX for Dummies Questions & Answers 2 03-16-2011 03:28 PM
Sending email with multiple files.. msrahman Shell Programming and Scripting 30 11-03-2010 01:58 PM
Sending email to multiple IDs sangharsh HP-UX 3 02-25-2010 02:03 PM
Sending Unix files as attachments in an email sangharsh HP-UX 7 02-04-2010 01:58 PM
Sending an email with more than one files thambi Shell Programming and Scripting 7 05-25-2007 09:52 PM



All times are GMT -4. The time now is 08:10 AM.