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
Script which can send file to diffrent mail ids. vpandey UNIX for Advanced & Expert Users 3 02-29-2008 06:48 AM
Pull E-mail address from file, send e-mail DC Heard Shell Programming and Scripting 1 01-28-2008 10:23 PM
How to attach a file & send mail thru script Mar1006 Shell Programming and Scripting 9 10-12-2006 05:54 AM
Send a mail with an attachement of a file gaddeg UNIX for Dummies Questions & Answers 2 07-23-2002 11:01 AM
Send text file to mail petrosi UNIX for Dummies Questions & Answers 2 02-20-2001 06:56 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-12-2007
Registered User
 

Join Date: Jun 2007
Posts: 4
Stumble this Post!
To send a mail with a file attached

Hi,

Can anyone please tell me how to send a mail to a person in unix with a file attached. The file need to be zipped and then i want to send the mail to a person.

I know that we can able to send mail from unix using the command
mail mailaddress

to send a mail to a person with the contents of a file
mail dest < filename

But how to send a mail to a person from unix with a file(file need to be send as a zip file) attached.

Please can anyone help me on this.

Thanks in advance
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-12-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Stumble this Post!
man zip
man uuencode
man mailx

and use search function on websites
Reply With Quote
  #3 (permalink)  
Old 06-12-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,572
Stumble this Post!
search the forum please
Reply With Quote
  #4 (permalink)  
Old 06-12-2007
Registered User
 

Join Date: Apr 2007
Posts: 75
Stumble this Post!
man sendmail
Reply With Quote
  #5 (permalink)  
Old 07-12-2007
psiva_arul's Avatar
Registered User
 

Join Date: Jul 2007
Location: Bangalore, India
Posts: 78
Stumble this Post!
mail command with attachment

Hi,

We can send mail from unix with text file instead of attached the file using mailx command.

SUBJECT="Example for mailx command"
FILE="textfile"
MAIL_DL="yourmail@mail.com\,
mymail@mail.com"

you can the following command for send the mail with attachement.

mailx -s "$SUBJECT" "$FILE" "$MAIL_DL"
OR
cat mailx -s "$SUBJECT" "$FILE" "$MAIL_DL"

Thanks,
Siva.P
Bangalore
Reply With Quote
  #6 (permalink)  
Old 07-16-2007
Registered User
 

Join Date: Apr 2007
Posts: 11
Stumble this Post!
try this

uuencode <filename> <filename> | mailx -s "Logs" <mailid>


example : "uuencode APP_LDAP.csv.gz APP_LDAP.csv.gz | mailx -s "Zipped logs" cooldude@yahoo.com"
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
mailx, mailx attachment, sendmail

Thread Tools
Display Modes




All times are GMT -7. The time now is 10:58 AM.


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

Content Relevant URLs by vBSEO 3.2.0