LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-23-2008, 01:32 AM   #1
meili100
LQ Newbie
 
Registered: Oct 2007
Posts: 25

Rep: Reputation: 15
Question How to use "mail" to attach a file with an email?


echo "content" | mail email@address -s subject
Where to attach a file with the email?
 
Old 02-23-2008, 02:00 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Now, I know you can do it, but I can't remember how.

However, the reason I don't remember is I found at the time that I needed to do it, the from the command line Mutt does the job just nicely.

So, if you have Mutt, give that a go.
 
Old 02-23-2008, 02:06 AM   #3
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I think if you still want to use mail that "mimencode" may be what you are after. Have a look at google
 
Old 02-23-2008, 02:27 AM   #4
meili100
LQ Newbie
 
Registered: Oct 2007
Posts: 25

Original Poster
Rep: Reputation: 15
Thanks. But I want to use something that I can send emails (with attachments) from shell command line. This way I can let my C++ program call it.

Mutt asks you to go through its interface.

Quote:
Originally Posted by billymayday View Post
Now, I know you can do it, but I can't remember how.

However, the reason I don't remember is I found at the time that I needed to do it, the from the command line Mutt does the job just nicely.

So, if you have Mutt, give that a go.
 
Old 02-23-2008, 03:21 AM   #5
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Quote:
Originally Posted by meili100 View Post
Mutt asks you to go through its interface.
Not when invoked as
Code:
mutt -s SUBJECT -a ATTACHMENT ADDRESS < /dev/null
 
Old 02-23-2008, 03:39 AM   #6
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Or use

Code:
cat attachment | uuencode attachment | mail -s subject user@example.com
 
Old 02-23-2008, 05:21 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
...or simply use 'mpack'?
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Tips and tricks: How do I use the "xm block-attach" command to attach additiona LXer Syndicated Linux News 0 08-21-2007 12:50 AM
Cannot send email using "mail" command. Madone_SL_5.5 Linux - Software 6 11-18-2006 03:22 PM
How to send email with attachment using "mail"? jonathanztaub Linux - Software 4 05-10-2004 11:53 AM
D-Link DWL-G520 on Debian - "unable to attach hardware; HAL status 13" dooberwah Linux - Wireless Networking 3 01-25-2004 11:43 AM
Attach a Attachment with the " mail command" robinhood1995 Linux - General 2 05-16-2002 11:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration