The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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



How do I send email? Learn how to send a UNIX or Linux email attachment from the command line.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to send an email with some body content and attachment balireddy_77 Shell Programming and Scripting 2 08-20-2008 06:33 AM
Command line/Script to send E-mail with HTML body and binary attachment G-Man AIX 3 04-18-2007 09:30 PM
AIX send mail with HTML message body and a binary attachment G-Man UNIX for Dummies Questions & Answers 4 03-22-2007 02:15 PM
How to send body in a mail rajendragora UNIX for Dummies Questions & Answers 6 06-30-2006 02:51 AM
sending mails with attachment and also some text in mail body guptan UNIX for Advanced & Expert Users 7 05-25-2006 06:17 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-24-2004
manojram manojram is offline
Registered User
  
 

Join Date: Aug 2003
Posts: 5
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
  #2 (permalink)  
Old 04-24-2004
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
See this thread.
  #3 (permalink)  
Old 04-25-2004
manojram manojram is offline
Registered User
  
 

Join Date: Aug 2003
Posts: 5
Thumbs up

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

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,407
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
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
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.
Sponsored Links
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:27 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0