Unix/Linux Go Back    


Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Need to attach a txt file while sending mail

Shell Programming and Scripting


Tags
mailx, mailx attachment

Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 01-09-2006   -   Original Discussion by charan81
charan81's Unix or Linux Image
charan81 charan81 is offline
Registered User
 
Join Date: Jan 2006
Last Activity: 22 May 2006, 1:44 PM EDT
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Need to attach a txt file while sending mail

Hi,

I need to attach a txt file while sending mail thru Unix.

Please help me out in this..

-Charan.
Sponsored Links
    #2  
Old Unix and Linux 01-09-2006   -   Original Discussion by charan81
matrixmadhan's Unix or Linux Image
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
 
Join Date: Mar 2005
Last Activity: 10 January 2017, 8:10 AM EST
Location: classification algos
Posts: 3,215
Thanks: 19
Thanked 31 Times in 28 Posts
sending attachment had been answered many times,

could you please make use of the search facility:

search the forum
Sponsored Links
    #3  
Old Unix and Linux 01-10-2006   -   Original Discussion by charan81
charan81's Unix or Linux Image
charan81 charan81 is offline
Registered User
 
Join Date: Jan 2006
Last Activity: 22 May 2006, 1:44 PM EDT
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
I need to attach a txt file as well as embed some text in the mail body.

Thanks..

I need to attach a txt file as well as embed some text in the mail body.

How to add the mail body(Some text) while attaching a file like this :

uuencode abc.txt abc.txt | mailx -s "Attaching test" user@domain.com

Charan.
    #4  
Old Unix and Linux 01-10-2006   -   Original Discussion by charan81
matrixmadhan's Unix or Linux Image
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
 
Join Date: Mar 2005
Last Activity: 10 January 2017, 8:10 AM EST
Location: classification algos
Posts: 3,215
Thanks: 19
Thanked 31 Times in 28 Posts


Code:
uuencode abc.txt abc.txt | mailx -s "Attaching test" user@domain.com < your_file_containing_message 

Sponsored Links
    #5  
Old Unix and Linux 01-10-2006   -   Original Discussion by charan81
charan81's Unix or Linux Image
charan81 charan81 is offline
Registered User
 
Join Date: Jan 2006
Last Activity: 22 May 2006, 1:44 PM EDT
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
It Doesnt attach the txt file while embedding the mail body.

Madhan,

I tried this already..

uuencode abc.txt abc.txt | mailx -s "Attaching test" user@domain.com < your_file_containing_message

This is sending out a mail with the body of the "your_file_containing_message"
file.Doesnt attach the txt file.

Charan.
Sponsored Links
    #6  
Old Unix and Linux 01-10-2006   -   Original Discussion by charan81
matrixmadhan's Unix or Linux Image
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
 
Join Date: Mar 2005
Last Activity: 10 January 2017, 8:10 AM EST
Location: classification algos
Posts: 3,215
Thanks: 19
Thanked 31 Times in 28 Posts
I am very sure the above command would work as requested.

Could you please post the exact command what you had tried?

That would be helpful to find out the problem.
Sponsored Links
    #7  
Old Unix and Linux 01-10-2006   -   Original Discussion by charan81
charan81's Unix or Linux Image
charan81 charan81 is offline
Registered User
 
Join Date: Jan 2006
Last Activity: 22 May 2006, 1:44 PM EDT
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
I have used this..

uuencode datetime.txt datetime.txt | mailx -s "Attaching test" charan.p@igate.com < mail.txt

I am receiving the mail with the body of the "mail.txt" file.
I dont receive the attachment.

Charan.
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script to attach file to mail sfetea Shell Programming and Scripting 4 11-26-2010 08:39 AM
Not able to attach text in body of email while sending mail with attachment jmathew99 Shell Programming and Scripting 6 05-07-2010 07:04 AM
How to attach a file in Linux mail command rohit22hamirpur Shell Programming and Scripting 1 12-05-2008 01:58 AM
How to attach a file & send mail thru script Mar1006 Shell Programming and Scripting 9 10-12-2006 09:54 AM
How to attach a file in mail? firebirdonfire UNIX for Dummies Questions & Answers 1 03-29-2001 07:38 AM



All times are GMT -4. The time now is 04:30 AM.