This article is from a FAQ concerning SCO operating systems. While some of the information may be applicable to any OS, or any Unix or Linux OS, it may be specific to SCO Xenix, Open Desktop or Openserver.

There is lots of Linux, Mac OS X and general Unix info elsewhere on this site: Search this site is the best way to find anything.

Unix, Xenix and ODT General FAQ

How can I send attachments from the command line?

Using mail from the command line: if you want to send true attachments (that show up in graphical mail clients as attachments), you need something like "mutt" (available from Skunkware and ftp://aplawrence.com/pub/mutt_osr5.tar.Z).


Hate these ads?

If it's just arbitrary text or a file you want to send, and don't care about it looking like a real attachment, you can use ordinary mail and do

mailx -s "This is it" someone@someplace < somefile

or

echo "text
more text" | mailx somebody somebodyelse fred@fred.com

You can use uuencode to send a binary file the same way, and some mail clients may even display that as they would a "real" attachment.

However: that's NOT an attachment. Every time somebody asks this question on the newsgroup, someone is sure to insist that it is, but a simple visual examination of actual messages should show them their error. The confusion is, of course, that some mail clients will act as though the uuencoded text were a proper attachment. That's fine if the people you are sending to use one of those clients, but if there is any chance they do not, be safe: use Mutt.


Technorati tags:  

Comments /SCOFAQ/FAQ_scotec6mailxmutt.html
To send an attachment via email from a command prompt, you can use the tool 'email'. This can be found at http://email.cleancode.org. This tool can use remote SMTP servers as well as "sendmail" to send messages. It also allows *proper* attachments. An example:

email -s "Attachment" -a coolpic.jpg user@domain.com

You can also redirect text:

email -s "Attachement" -a coolpic.jpg user@domain.com < somefile

You can send an empty email with just the attachment:

email -s "Attachment" -a coolpic.jpg -b user@domain.com

Email can also send to SMTP servers that expect authentication (SMTP AUTH) and has neat features such as an address book and dynamic signature files. Email ALSO works well with GPG/PGP for encryption.


--

Thanks: See http://aplawrence.com/Reviews/cleancodeemail.html

--TonyLawrence


---December 30, 2004

I use "mpack", which I just found in debian repository.

e.g.:
mpack -s "My Subject" /tmp/myfile user@domain.com

Edward van Kuik

---


---December 30, 2004



Mon Apr 16 19:36:06 2007: Subject: Mutt email attachment.   weiss1rogerscom
I have been using MUTT to send email with pdf or htm attachments from the command line. Works well as long as you have a proper .mime file setup.



Cheers

Add your comments

ad

Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)

Or use any RSS reader

Delivered by FeedBurner


Change Congress

Views for this page
Today This Week This Month This Year  Overall
421498088,607 37,506

/SCOFAQ/FAQ_scotec6mailxmutt.html copyright 1997-2003 (various) All Rights Reserved

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

More:
       - FAQ




Related Posts

GPG/PGP Basics

CleanCode Email

OS X file encryption

SSL,TLS,openssl

Linux Skills Test GPG

Random numbers


Unix/Linux Consultants


http://thatitguy.com Business networking servers, Linux and Unix experts. In business since 1997! Windows and Exchange to Samba and Scalix migration experts.


http://echo3.net/ Unix/Linux Custom Applications, Web Hosting, C/C++ Programming Courses


http://www.cleverminds.net Need expert advice? Want a second opinion? CleverMinds is a one-stop-shop for a wide range of technology solutions. We support Unix, Linux, SCO as well as CMS, ecom, blogs, podcasts, search engines consulting and more. Contact us at web2.0@cleverminds.net 0r (617) 894-1282


Twitter
  • May 12 16:04
    Hmmm.. think I'm doing something at the gym that is hurting my neck.. not sure what.. I'll have to eliminate something for a few days to see
  • May 12 05:02
    It's not good to sound annoyed with customers:









Change Congress

Related Posts