The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers > Answers to Frequently Asked Questions > How do I send email?
Google UNIX.COM
Home Forums Register Rules & FAQ Members List Arcade Search Today's Posts Mark Forums Read


How do I send email? How do I send an mail attachment from the command line?


Other UNIX.COM Threads You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sending email attachments venush UNIX for Dummies Questions & Answers 2 4 Weeks Ago 10:42 PM
Sending text files as attachments radhika03 Shell Programming and Scripting 2 06-07-2007 07:17 AM
sending attachments in mail rajendragora UNIX for Dummies Questions & Answers 6 01-31-2007 08:13 PM
sending attachments via unix Abhishek Ghose UNIX for Advanced & Expert Users 6 09-30-2005 01:49 PM
sending files as attachments SmartJuniorUnix UNIX for Dummies Questions & Answers 9 04-13-2001 04:34 AM

 
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-01-2000
Registered User
 

Join Date: Sep 2000
Location: UTAH
Posts: 27
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Question

How do I send a file as an attachment on a Unix system
Forum Sponsor
  #2 (permalink)  
Old 10-01-2000
Neo's Avatar
Neo Neo is offline
Administrator
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 3,955
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!

Sending and attaching files on UNIX-like system can be done in a myriad of ways. It really depends on the mail client you are using and how you are using it.


In web-based clients like Netscape browsers, you simple click and add the attachment from the browser GUI.


The same is true for almost all GUI-based email clients.


From the command line, elm(), sendmail() and a host of others allow you to easily send files from the command line.


Most editors, vi(), et. al. allow you to read in the file, but you might want to convert to an ASCII friendly format first. There are many tools to do this. The old ones had names like uuencode() and uudecode(). Now, there are so many it is hard to keep track of them and there are used in all types of MIME setups.


To answer your question specifically, you need to specify the exact email client you are using. WWW-based email clients are popular these days, of course; but for auto-generated mail responders, etc. a command line tool is best.

  #3 (permalink)  
Old 10-01-2000
Registered User
 

Join Date: Sep 2000
Location: UTAH
Posts: 27
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
From Command Line

uuencode [file] | mail xxx@xxx.com

this is what I've attempted. I somewhat works.

If I run this from the command line, I only get a portion of the file. I ultimately need to set this up through a crontab, So I am testing it from the command line. When I receive the message, It arrives as an attachment, but the file is corrupted.. I believe it's because of the way I am exiting the mail program. CTRL-D.

The file that ultimately needs to be sent is approximately 12 MB. I figure this would take a while. This is where I decided to try it with a much smaller file (1KB). But it still seems that the mail prog will not close out on it's own.

Let me know what you think or if you need more details.
  #4 (permalink)  
Old 10-25-2000
PxT's Avatar
PxT PxT is offline
Registered User
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 903
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
You need to look for a tool called 'mimencode'. This will do what you want. The documentation details how to process files from the command line.
  #5 (permalink)  
Old 04-10-2001
Registered User
 

Join Date: Apr 2001
Posts: 6
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Exclamation Mail attachments from unix

I have to translate a microfocus COBOL--generated ascii report file into pdf and attach it in an e-mail kicked off from within the following cgi script:
if [ "$EMAIL" = "Y" ]; then
sed -e '/^H_/s///g' <$REPFILE >$REPFILE2

print "


Emailing to $EMAILID

"
(
echo "To: $EMAILID"
echo "Subject: OK - Drawing $DRWID Issue $DRWISS Certified White Report
Content-Type: multipart/mixed;
boundary=\"------------F31625F689894DCE7A7A828F\"

This is a multi-part message in MIME format.
--------------F31625F689894DCE7A7A828F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit"

echo "
White Report from Certified Data included within:
Drawing ID = $DRWID
Issue = $DRWISS
ChgAnal = $CHG"
if [ "$CHG" = "Y" ]; then
echo "ChgAnalIss = $CHGISS"
fi
echo "Manuf Doc = $MFG"
echo "--------------F31625F689894DCE7A7A828F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
"
cat $REPFILE2
echo "--------------F31625F689894DCE7A7A828F--"
) | mailx -t
------------------------------------------------------------
I can use postprint to go from ascii--->ps, and then I can use Acrobat's distill to convert the ps--->pdf, but how do I then attach the resulting pdf in an e-mail?
I've read all the threads here and I don't see an answer.
Please help. What am I missing? There is no option to mailx to attach, and the RFC822 was no help. We have to use mailx.
Thank you.
Google UNIX.COM
 



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

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



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

Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102