Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
google site



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-26-2001
Registered User
 

Join Date: Sep 2001
Location: Green Bay, WI
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
email attachment, with a message using mailx

Hi, I am trying to include a message along with an attachment with an email using mailx on AIX.

uuencode Test.dat Test.dat| mailx -s 'Testing' mymail@yahoo.com < MESGFILE

This only gives me the contents of MESGFILE as my message.

If I remove the < FILE I recieve the attachment.

What I want is both the attachent and the message in MESGFILE.

I've checked out the FAQ and I would really like to use mailx so I don't have to wait a month to have my admin install any new tools. Any help/ideas would be appreciated.
Sponsored Links
  #2  
Old 09-26-2001
Registered User
 

Join Date: Sep 2001
Location: Green Bay, WI
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Never mind, I figured it out, If I uuencode the file to attach first and then cocatenate the 2 files ' cat mesgfile attachfile > combo

and use mailx -s "Test Subject" mymail@yahoo.com < combo

this works,
  #3  
Old 09-27-2001
sanjay92
Guest
 

Posts: n/a
Bits: 0 [Banking]
This is the perfect example for sending email with attachment and the message.

http://www.uaex.edu/bknox/email_with_attachment.htm
  #4  
Old 09-28-2001
Registered User
 

Join Date: Aug 2001
Location: Ontario, Canada
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
I think following command should work,

( cat mesgfile ; uuencode Test.dat Test.dat ) | mailx -s 'Testing' mymail@yahoo.com

because I like to send mail in my RH Linux 6.0 like this,

(echo From: Eddie [eddie@swh.com]; echo Subject: Testing ; echo To: My friends; cat messagefile ; uuencode -m attach.file1 attachname1 ; uuencode -m attach.file2 attachname2 ) | sendmail `cat recipients-list`

The "recipients-list" contains the email addresses like following, for example,

john@yahoo.com
david@hotmail.com
mark@aol.com
sandy@mail.emerld.com
......

This is handy. You can also put this simple command into a shell script if you like. Note the brackets [ ], they should be angle brackets which are treated like special characters and can not be displayed in this BBS.

Hope this helps.

Last edited by eddie; 09-28-2001 at 12:31 AM..
  #5  
Old 09-28-2001
sanjay92
Guest
 

Posts: n/a
Bits: 0 [Banking]
Smile Great

It works.

Thanks
Sanjay
Sponsored Links
Closed Thread

Bookmarks

Tags
mailx, mailx attachment

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem while sending message and attachment with mailx nihar.dutta Shell Programming and Scripting 2 08-09-2007 11:15 AM
How to send attachment to web-based email client using mailx randomcz1 Shell Programming and Scripting 1 11-07-2006 04:00 PM
Sending email with text & attachment using mailx haryadoon Shell Programming and Scripting 3 07-27-2006 01:49 AM
mailx error message : mailx: NUL changed to @ BG_JrAdmin UNIX for Dummies Questions & Answers 2 12-01-2005 09:27 AM
Extract or save attachment of email using mailx kandati UNIX for Dummies Questions & Answers 1 02-26-2005 10:15 AM



All times are GMT -4. The time now is 07:46 AM.