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 > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics 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 09:30 PM
Line Count & MAil Issues Remi UNIX for Dummies Questions & Answers 3 12-02-2006 11:15 PM
command line send mail ejbrever UNIX for Dummies Questions & Answers 1 08-29-2006 07:30 PM
Mail attatchment line length brown_b UNIX for Advanced & Expert Users 5 11-05-2003 11:56 AM
E-Mail from command line for UNIX and Perl?? jy2728 Shell Programming and Scripting 4 11-26-2002 05:02 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-30-2008
VijayakumarN VijayakumarN is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 6
Smile How to mail in command line.

Hi
Can any one guide me how to mail in ssh command terminal with help of mutt or sendmail command from a proxy client machine . My proxy server is using squid proxy.
  #2 (permalink)  
Old 09-01-2008
Annihilannic Annihilannic is offline Forum Advisor  
  
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 1,009
Most flavours of Unix have a mail or mailx command which you can use like this:

Code:
mail -s "a subject" recipient@example.com << HERE
some email body
HERE
  #3 (permalink)  
Old 09-01-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
If mutt is available, that offers a richer set of options, and the ability to sensibly include attachments to the message, with basically the same syntax.

Sendmail works the same way, too, but you need to put the headers in the message yourself.

Code:
sendmail -oi -t <<HERE
From: user@example.net
To: recipient@example.com
Subject: AYBABTU

All your base are belong to us
HERE
This is a FAQ; if you need more help, please search this site for threads related to your problem.
  #4 (permalink)  
Old 09-01-2008
broli's Avatar
broli broli is offline
Registered User
  
 

Join Date: Dec 2007
Location: Argentina
Posts: 212
Quote:
Originally Posted by era View Post
If mutt is available, that offers a richer set of options, and the ability to sensibly include attachments to the message, with basically the same syntax.

Sendmail works the same way, too, but you need to put the headers in the message yourself.

Code:
sendmail -oi -t <<HERE
From: user@example.net
To: recipient@example.com
Subject: AYBABTU

All your base are belong to us
HERE
This is a FAQ; if you need more help, please search this site for threads related to your problem.
you have some ways to send files with mail/mailx
  #5 (permalink)  
Old 09-01-2008
dennis.jacob dennis.jacob is offline Forum Advisor  
dj -------
  
 

Join Date: Feb 2007
Location: Cochin/Singapore
Posts: 515
Quote:
Originally Posted by broli View Post
you have some ways to send files with mail/mailx
You can try like:

Code:
mail user@domain.com -c cc_user@domain.dom -s "Subject line" < filename
  #6 (permalink)  
Old 09-01-2008
broli's Avatar
broli broli is offline
Registered User
  
 

Join Date: Dec 2007
Location: Argentina
Posts: 212
Quote:
Originally Posted by dennis.jacob View Post
You can try like:

Code:
mail user@domain.com -c cc_user@domain.dom -s "Subject line" < filename
i was talking about

(echo "Body of e mail"; uuencode <list of files> ) | mailx -s "Subject of email" mail@addres
  #7 (permalink)  
Old 09-01-2008
Annihilannic Annihilannic is offline Forum Advisor  
  
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 1,009
uuencode only accepts one file at a time, so you may need multiple uuencode commands or a for loop. The first optional parameter is the name of the local file, and the second paramater is the name given to the attachment. They are both assumed to be the same if only one parameter is given.
Sponsored Links
Closed Thread

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 10:20 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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