LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-29-2004, 08:02 PM   #1
naijaguy
Member
 
Registered: Aug 2004
Posts: 88

Rep: Reputation: 15
using "mail" program


I did a locate mailto on my Red Hat box, but found nothing. However, I have mail...I'd like use "mail" to send an email to myself from the command line. Is this possible? In other words, when you just install a recent Red Hat distro, does it come with the ability to go to the command line and type a simple string that will send an email to someone? Or do you always have to go through some major installation/configuration of sendmail or something like that?

Last edited by naijaguy; 12-29-2004 at 08:16 PM.
 
Old 12-29-2004, 08:31 PM   #2
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 35
A lot will depend on whether you are sending it to a user on the host machine, or out to the world. Usually, you need either a mail server set up, or to use something like pop3

However, for your question.

mail [username] is the syntax

example: mail joe
or
mail joe@somewhere.com

You will be prompted for a subject.

Yoiu can specify the subject right from the start also such as
mail -s "Some mail for you" joe@somewhere.com

You can also send the contents of a file as well.

mail -s "A message for you" joe@somewhere.com <some_file_name
 
Old 12-29-2004, 08:42 PM   #3
naijaguy
Member
 
Registered: Aug 2004
Posts: 88

Original Poster
Rep: Reputation: 15
Ah...I want to send it out to the world. That's much harder to get set up, isn't it?
 
Old 12-30-2004, 04:00 AM   #4
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
As long as your nameservers are setup appropriately and that you have sendmail running then yes, you can send mail out to the world

-twantrd
 
Old 12-30-2004, 06:28 AM   #5
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
Quote:
Originally posted by twantrd
As long as your nameservers are setup appropriately and that you have sendmail running then yes, you can send mail out to the world

-twantrd
Although this is known as 'Spam'
 
Old 12-30-2004, 10:48 AM   #6
naijaguy
Member
 
Registered: Aug 2004
Posts: 88

Original Poster
Rep: Reputation: 15
I know the chances of you believing me are not that great, but these emails are sent to our customers for shipment notifications. I need to be able to do non-text attachments for some of them because occasionally our customers will actually email a shipment label to someone. I have seen some code before for doing a binary attachment using Java, but it's a bit complicated. I would rather not install JavaMail for this one special case.

On Windows, our web app would use the Blat command line utility to send an email with an attachment. However, it seems like there's nothing that simple on Linux, or maybe I'm missing something...when I send an email with either Blat or Java code, I just connect to our ISP's SMTP server by setting it as the host, and then I can email all day long. I've tried to figure out how to do this with mutt or mail or something like that, but it seems like in order to do that I have to have a sendmail server running. But maybe I'm wrong--maybe mutt can run as long as you tell it what the SMTP server is (I just haven't figured out where to configure that).

When I try to send an email with mutt from the command line, it doesn't tell me there's an error, but I also never get the email...


 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shel script mail send ("/" in mail address) problem anaid Linux - Networking 3 08-23-2005 08:41 AM
Qmail problem: ISP mail and virtual mail, "sorry no mailbox, here by that user" barryw Linux - Networking 7 05-28-2005 01:43 PM
C -communicating with system("ftp"); using "program|ftp>>myfifo" probably hansschmucker Programming 1 03-23-2005 02:39 PM
Getting error: "ALSA device "default" is already in use by another program." brynjarh Debian 7 02-04-2005 12:45 PM
"mail" and "mailx" lost. yapp Slackware 2 10-27-2003 12:35 PM


All times are GMT -5. The time now is 10:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration