How to send mail with attachment in Unix | 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.

How to send mail with attachment in Unix

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 04-03-2012
parthmittal2007 parthmittal2007 is offline
Banned
 
Join Date: Dec 2011
Last Activity: 5 March 2013, 1:31 AM EST
Posts: 193
Thanks: 22
Thanked 2 Times in 2 Posts
How to send mail with attachment in Unix

Hi All,
Is it possible to send mail in Unix with attachment.
If yes, then how??
Sponsored Links
    #2  
Old 04-03-2012
bmk bmk is offline
Registered User
 
Join Date: Dec 2011
Last Activity: 31 October 2013, 9:16 AM EDT
Posts: 262
Thanks: 1
Thanked 22 Times in 22 Posts
Try like..


Code:
mail -s "hi"  test@gmail.com< test1.txt

Sponsored Links
    #3  
Old 04-03-2012
parthmittal2007 parthmittal2007 is offline
Banned
 
Join Date: Dec 2011
Last Activity: 5 March 2013, 1:31 AM EST
Posts: 193
Thanks: 22
Thanked 2 Times in 2 Posts
But the file is not attached in this code
    #4  
Old 04-03-2012
bmk bmk is offline
Registered User
 
Join Date: Dec 2011
Last Activity: 31 October 2013, 9:16 AM EDT
Posts: 262
Thanks: 1
Thanked 22 Times in 22 Posts
check test1.txt is the file...
Sponsored Links
    #5  
Old 04-03-2012
parthmittal2007 parthmittal2007 is offline
Banned
 
Join Date: Dec 2011
Last Activity: 5 March 2013, 1:31 AM EST
Posts: 193
Thanks: 22
Thanked 2 Times in 2 Posts
That i know, But i want that when the mail should come it should contain the attached file.
Sponsored Links
    #6  
Old 04-03-2012
nikhil jain nikhil jain is offline
Registered User
 
Join Date: Apr 2011
Last Activity: 28 July 2014, 3:39 AM EDT
Location: Bangalore
Posts: 100
Thanks: 24
Thanked 2 Times in 2 Posts
This shul work

uuencode filename filename.txt | mailx -s " SUBJECT" -r nik@abc.com ram@abc.com
Sponsored Links
    #7  
Old 04-03-2012
itkamaraj's Avatar
itkamaraj itkamaraj is offline Forum Advisor  
^Kamaraj^
 
Join Date: Apr 2010
Last Activity: 16 July 2014, 11:41 PM EDT
Posts: 3,057
Thanks: 33
Thanked 657 Times in 636 Posts
try with mutt command
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
how to run a script using cron job and send the output as attachment via e-mail using unix vidhyaS Shell Programming and Scripting 8 06-09-2011 02:20 AM
send mail from AIX unix with multiple attachment rsivasan Shell Programming and Scripting 3 02-21-2011 07:24 AM
How to send html file in a mail not as an attachment but it should display in the mail in table for mani_isha UNIX for Dummies Questions & Answers 0 03-30-2010 03:37 AM
How to send a mail with attachment? albaalbetti Shell Programming and Scripting 4 11-19-2009 10:59 AM
how to send a attachment mail in unix mail2sant Shell Programming and Scripting 6 11-20-2008 01:02 AM



All times are GMT -4. The time now is 01:22 AM.