The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sending multiple attachments deo2k8 Shell Programming and Scripting 1 01-07-2008 10:12 PM
Sending Attachments Through mailx vrk1219 HP-UX 4 08-27-2007 08:06 AM
sending attachments via unix Abhishek Ghose UNIX for Advanced & Expert Users 6 09-30-2005 01:49 PM
sending files as attachments SmartJuniorUnix How do I send email? 9 04-13-2001 04:34 AM
sending files as attachments SmartJuniorUnix UNIX for Dummies Questions & Answers 9 04-13-2001 04:34 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-25-2006
Registered User
 

Join Date: Jun 2006
Posts: 8
Post sending attachments in mail

Hi ,

i have tried the following command to send an email with an attachment
its working fine but i am getting mail with the embeded content inside the mail that too truncated.

i wanted it as an attachment.

/usr/lib/sendmail -F "MAC SIA" address "rajendra@abc.com.sg" -t < /prod/applc/ds_data/mac/working/nullctry.txt


regards
Rajesh
Reply With Quote
Forum Sponsor
  #2  
Old 06-26-2006
grial's Avatar
El UNIX es como un toro
 

Join Date: Jun 2006
Location: Madrid (Spain)
Posts: 531
Hi, for that you could use "uuencode" and "mail" commands:
Code:
(cat text.txt; uuencode /prod/applc/ds_data/mac/working/nullctry.txt /prod/applc/ds_data/mac/working/nullctry.txt) | mail rajendra@abc.com.sg
Assuming that:
- text.txt contains the body of the email, so this is optional.
- /prod/applc/ds_data/mac/working/nullctry.txt is the file you want to attach.
Reply With Quote
  #3  
Old 06-26-2006
Registered User
 

Join Date: Jun 2006
Posts: 8
thanks but the output is not in desired format

Hi grail,

i have used both the scripts

(cat nullctry.txt; uuencode /prod/applc/ds_data/mac/working/nullctry.txt /prod/applc/ds_data/mac/working/nullctry.txt) | mail RajendraP_Gora@abc.com.sg

and also

(cat nullctry.txt; uuencode nullctry.txt </prod/applc/ds_data/mac/working/nullctry.txt ) |
mail RajendraP_Gora@abc.com.sg

i could get the attachment. the problem is the lines are continious
for eg

the original is 1,2,3,4
a,b,c,d
x,y,z,i

but in mail the attachment is like this 1,2,3,4a,b,c,dx,y,z,i

thanks for your response

Reagards
Rajesh
Reply With Quote
  #4  
Old 06-26-2006
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
what is the need for seperate cat and then to use uuencode for that..

if your file is content

then use it as


uuencode content content.txt and then with mail -- this should work
Reply With Quote
  #5  
Old 06-26-2006
Registered User
 

Join Date: May 2005
Posts: 19
Rajendra

Do you mean that the contents of the original attached file varies from that you got in the mail? If your answer is yes, I am surprised. What I have used for this purpose is the one given below and always I used to get the file as it is.

uuencode FileNameWithPath "AttachmentName" | mailx -s "MailSubject" MailAddress

For example If I send the File abcd.xls as

uuencode /home/usr/bb/abcd.xls "AttendanceList.xls" | mailx -s "List Of Attendance" rajendra@yahoo.com

Then the file abcd.xls will be attached in the mail with the name AttendenceList.xls and the mail subject will be - List Of Attendance.

Hope this helps.
Thank you
Reply With Quote
  #6  
Old 06-26-2006
Registered User
 

Join Date: Jun 2006
Posts: 8
Thanks a lot bobby it works fine for csv :)

Thanks a lot bobby it works fine for csv

i changed it to csv and it works fine . but for txt same problem

any way my problem is resolved thanks a lot


Regards
Rajesh
Reply With Quote
  #7  
Old 01-31-2007
Registered User
 

Join Date: Jan 2007
Posts: 5
When i sent with an attachment(text file), the format for my text file is incorrect. Some of the fields went to the next line. I have already changed unix2dos.If i use EditPlus or UltraEdit to open this file, the format is what i want.How can i ensure that the text file is long enough to contain the format that i want ?

unix2dos -ascii $sqloutfile $emailoutfile
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
sendmail

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:19 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0