LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-09-2008, 10:31 AM   #1
stalin.varanasi
LQ Newbie
 
Registered: Dec 2007
Posts: 7

Rep: Reputation: 0
how to mail to gmail from unix "mail" program


Well ,thats a stupid question I know.But lets see a correct answer.

Last edited by stalin.varanasi; 09-28-2011 at 08:16 AM.
 
Old 09-09-2008, 10:43 AM   #2
CRC123
Member
 
Registered: Aug 2008
Distribution: opensuse, RHEL
Posts: 374
Blog Entries: 1

Rep: Reputation: 32
run 'ifconfig' command under root and see if you have an 'eth' entry that shows an ip address in 'inet addr:'. Then, mail is easy:

Code:
<echo or cat message> | mail username@gmail.com
Read the mail (really mailx) man pages for more info on things like subject and such
 
Old 09-09-2008, 10:45 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by stalin.varanasi View Post
Hi,
Can I mail to gmail or any other mail from the program "mail" in unix.I dont know whether internet is connected to my system.But when I run netstat -rn command these are the first 10 lines.

Kindly help.
-Stalin
To answer your question, the short answer is yes, you can.

You need to first figure out if you're connected to the internet or not. Then you need to set up your system to use the gmail servers for mail. You don't say what distro/version of linux you're using, or anything about your environment, so it's hard to give you any answer other than a generic "yes".

Lots of documentation can be found on Google....try there.
 
0 members found this post helpful.
Old 09-09-2008, 04:35 PM   #4
kkhagani
LQ Newbie
 
Registered: Sep 2008
Posts: 3
Blog Entries: 1

Rep: Reputation: 0
I thinks the syntax is:

echo "this is a message" | mailx <yourgmail@gmail.com>
 
Old 09-10-2008, 02:59 AM   #5
stalin.varanasi
LQ Newbie
 
Registered: Dec 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Hi, thanks for the reply

Last edited by stalin.varanasi; 09-28-2011 at 08:17 AM. Reason: I am not satisifed with the answers.
 
Old 09-28-2011, 09:56 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by stalin.varanasi View Post
Hi, thanks for the reply
Sorry you're not "satisfied with the answers", but you still haven't provided any information to let folks help you. From my first reply:

"You need to first figure out if you're connected to the internet or not. Then you need to set up your system to use the gmail servers for mail. You don't say what distro/version of linux you're using, or anything about your environment, so it's hard to give you any answer other than a generic "yes"."

So:
  1. Are you connected to the Internet? Can you use your web browser and hit any sites? Ping google.com?
  2. What version/distro of Linux?
  3. What environment? (Home, business? What firewalls/routers/switches are in place?)
  4. Did you try the commands given, and what were the results?
Again, without useful details, there's very little anyone can tell you.
 
  


Reply



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
How might I restore kmail folders/mail/settings from a "badly" saved "home"? deh6 Linux - Software 5 03-08-2008 09:25 PM
How to use "mail" program from System() call in C? minhsangniit Programming 2 08-19-2006 12:08 AM
Sending mail with some attached files using "mail" command? zahadumy Linux - Software 3 05-27-2006 10:43 PM
Shel script mail send ("/" in mail address) problem anaid Linux - Networking 3 08-23-2005 07:41 AM
Qmail problem: ISP mail and virtual mail, "sorry no mailbox, here by that user" barryw Linux - Networking 7 05-28-2005 12:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:22 PM.

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
Open Source Consulting | Domain Registration