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
how to send an email with some body content and attachment balireddy_77 Shell Programming and Scripting 2 08-20-2008 03:33 AM
script to send a file in email dr46014 Shell Programming and Scripting 2 12-10-2007 04:38 AM
How to send file contents to email teaspoon_ver2 UNIX for Advanced & Expert Users 4 01-11-2007 12:21 PM
How to send body in a mail rajendragora UNIX for Dummies Questions & Answers 6 06-29-2006 11:51 PM
Send Mail with attachment and a body manojram How do I send email? 4 04-26-2004 08:53 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-08-2008
Registered User
 

Join Date: Apr 2008
Posts: 11
Stumble this Post!
To send an email with the body content extracted from a file

Hi,

I have been trying to shoot an email with the email body to be obtained from a file.

Can someone please help me with it..

I have been trying to use the MAILX commad for the same.

mailx -s "test email" -r sender@test.com < file.txt

but it sends the file as an attachment,while i need the contents of File.txt in the email Body.Appreciate any help...Thanks,
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-08-2008
joeyg's Avatar
premier etoile de match
 

Join Date: Dec 2007
Location: Home of world champion Boston Celtics
Posts: 625
Stumble this Post!
Question I have used a similar command

for quite a few applications/scripts:

where I previously set
subjmsg to text
and logf is the text of my program execution

Code:
mailx -s "$subjmsg" who@company.com <$logf
Where you say this appears as an attachment, can you send to another email address and check that account. Presumably with a different domain, you might use a different email program. (My thinking is that your email client on the receiving side is doing this.)
Reply With Quote
  #3 (permalink)  
Old 05-08-2008
Registered User
 

Join Date: Nov 2006
Posts: 252
Stumble this Post!
Quote:
Originally Posted by rohit.shetty84 View Post
Hi,

I have been trying to shoot an email with the email body to be obtained from a file.

Can someone please help me with it..

I have been trying to use the MAILX commad for the same.

mailx -s "test email" -r sender@test.com < file.txt

but it sends the file as an attachment,while i need the contents of File.txt in the email Body.Appreciate any help...Thanks,
I think you maybe need to do uuencode, first gzip up the file

uuencode <filename> <filename> | mailx -s <something>
Reply With Quote
  #4 (permalink)  
Old 05-11-2008
Registered User
 

Join Date: May 2008
Posts: 4
Stumble this Post!
Try this

Try this code..Hope this works..

uuencode abc.zip 'basefile abc.zip' |mailx -s "some text " abc@abc.com

or


uuencode abc.zip `basefile abc.zip` |mail -s "some text " abc@abc.com
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
mailx, mailx attachment

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:37 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