Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 09-12-2010, 04:19 PM   #1
LQ Newbie
Registered: Aug 2010
Posts: 20

Rep: Reputation: 1
How to send an e-mail with the command line?

Hello everybody :-)

I'm new with mail servers and I want to send a simple mail from my terminal and I need some help...

I'm using opensuse and a Know that I have postfix installed...

I don't know what I need configure first...

I know that I need a SMTP server to send e-mails write?

When I try send e-mail with the command mail I received this message :

mail -s "meeting reminder" -c

(host [] refuse to talk to me: 421 cannot conect to SMTP server.
I was reading about fetchmail But I can't understand....

I don't want only de answer.. I want a help to know what I need to study first. :-)

Thanks in advanced
Old 09-12-2010, 05:53 PM   #2
Registered: May 2010
Posts: 83

Rep: Reputation: Disabled
Short answer:

If your local mail server is Postfix, then you should be able to configure it to forward mail to a remote SMTP server by editing, like this:

	relayhost =
If you're using sendmail, the file would be "/etc/mail/relay-domains"

Here are more details for Postfix:
Old 09-12-2010, 05:57 PM   #3
Registered: May 2001
Posts: 29,359
Blog Entries: 55

Rep: Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546Reputation: 3546
Originally Posted by 14moose View Post
Short answer
...the long answer being that Hotmail forces SenderID, a mcrsft-assimilated derivative of SPF.
Old 09-12-2010, 10:19 PM   #4
Registered: May 2010
Posts: 83

Rep: Reputation: Disabled
...the long answer being
Actually, the "long answer" can get VERY long

I just wanted to make sure the OP covered the "basics" before delving into more detail. There are a LOT of things that can go wrong.

Here are two good links:

Controlling E-Mail Spam

You Might Be an Anti-Spam Kook If...

professorgenival -

1. Your "mail -s" syntax should work fine

2. The main issue is that you need to find a good "relay server", and configure Postfix (and, possibly other stuff) appropriately.

'Hope that helps
Old 09-13-2010, 02:05 AM   #5
LQ Newbie
Registered: Sep 2010
Posts: 5

Rep: Reputation: 0
you can use mutt also with your sendmail or postfix MTA.

You can configure your postfix in /etc/postfix/ in RHEL 5

Three main configurations are to be done in the file.

authentication (who can send email)

Note: you can also use mutt for pop and imap service with SSL

mutt -f pop://username@servername


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
Debian etch - Unable to send mail from command line or from php mail command lqforumuser Linux - Newbie 1 03-01-2009 06:56 AM
command line email client to send mail to remote mail server dhanju Linux - Software 1 03-07-2008 06:37 AM
How to send mail from command line buskmann Linux - Newbie 7 07-23-2006 10:18 PM
can i send mail from command line? iflorea Linux - Software 6 11-02-2005 07:08 AM
Command Line Send Mail nutthick Linux - Newbie 10 01-24-2005 07:52 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:04 PM.

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