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?

LinkBacks (?)
LinkBack to this Thread: http://www.unix.com/how-do-i-send-email/13766-send-mail-attachment-body.html
Posted By For Type Date
Similar Threads inside forums - vBulletin.org Forum This thread Refback 2 Weeks Ago 07:26 AM

Other UNIX.COM Threads You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Command line/Script to send E-mail with HTML body and binary attachment G-Man AIX 3 04-18-2007 06:30 PM
AIX send mail with HTML message body and a binary attachment G-Man UNIX for Dummies Questions & Answers 4 03-22-2007 10:15 AM
how to send an email with some body content and attachment balireddy_77 Shell Programming and Scripting 1 11-28-2006 10:38 PM
How to send body in a mail rajendragora UNIX for Dummies Questions & Answers 6 06-29-2006 11:51 PM
sending mails with attachment and also some text in mail body guptan UNIX for Advanced & Expert Users 7 05-25-2006 03:17 AM

 
 
Submit Tools LinkBack (1) Thread Tools Search this Thread Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 04-24-2004
Registered User
 

Join Date: Aug 2003
Posts: 5
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Send Mail with attachment and a body

Hi All,

I am using a shell script where i will be sending a mail with some text/message in it and an attachment.

The problem starts here:

i am not able to do both the things together. i.e., either i am able to send some message or an attachment.

the problem is not only with my script the mail command of unix is also outputing the same result. What i would like to know is, do i have to do some settings or please tell me what am i doing wrong.

from the command line i am using:

1.) uuencode pic.jpg pic.jpg | mail abc@xyz.com < body.txt

2.) (cat body.txt uuencode pic.jpg pic.jpg) | mail abc@xyz.com body.txt

and many more.

please help

Regards,
Manoj
Forum Sponsor
  #2 (permalink)  
Old 04-24-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,206
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
See this thread.
  #3 (permalink)  
Old 04-25-2004
Registered User
 

Join Date: Aug 2003
Posts: 5
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Thumbs up

Thank you very much.
  #4 (permalink)  
Old 04-26-2004
Ygor's Avatar
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,206
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Syntax is:
Code:
(  cat body.txt 
   uuencode pic.jpg pic.jpg
) | mailx -s "subject" abc@xyz.com
  #5 (permalink)  
Old 04-26-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,206
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Quote:
Originally posted by Ygor
Syntax is:
Code:
(  cat body.txt 
   uuencode pic.jpg pic.jpg
) | mailx -s "subject" abc@xyz.com
I tried that on both HP-UX and SunOS. It works on SunOS but fails on HP-UX. I'm not sure how it will behave on other systems. On Linux, I didn't find a mailx, but I tried mail and it worked with that.

With HP-UX, I get a a large body that has the line line of body.txt immediately followed by a "begin 775 xyz.jpg" line. This is actually the behavior that I would expect. It works on SunOS because Sun's mailx is inspecting the mailed text and guessing at the placement of the mime headers. On SunOS, if I switch from mailx to mail, it no longer works.

This would seem to mean that if I intentionally wanted to include a uuencoded item in my body, that Sun's mailx would not let me.
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:28 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