I am trying to use postfix to send emails from linux host to my email address which is hosted on Microsoft Exchange Server. Linux host is on the same network. I do not understand all the detailed instructions. I want is to use a simple command line to send email from linux host to my email address.

Something like:

sendmail abc@company.com < mail.file

How can I do that ?

closed as not a real question by mailq, Shane Madden, Chris S, Ward, Iain Dec 10 '11 at 8:43

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

  • What's wrong with the command above? It works! – mailq Dec 10 '11 at 0:44
  • Thanks. I had to add myhostname = localhost in /etc/postfix/main.cf. It works now. – abc Dec 10 '11 at 0:48

Postfix is a full blown SMTP suite, you don't need that to send simple emails.

For that, there's many command line tools: mailx (aka mail) pine, mutt.

I'm a mailx fan myself:

mail -s 'subject' user@email.com < file

Mutt is more comprehensive and allows attachments.

  • Thanks for response. I tried using mail the way you have demoed. But I don't see any emails coming to me. Is there some configuration I need to change. – abc Dec 10 '11 at 0:32
  • Make sure you give things some time - Also check your spam folder. – thinice Dec 10 '11 at 0:40
  • 2
    There are other things that may be holding the email from delivery - look at tail /var/log/maillog to see if there's any clues (Assuming your mail log file may differ slightly in name) – thinice Dec 10 '11 at 0:41
  • Thanks. I had to add myhostname = localhost in /etc/postfix/main.cf – abc Dec 10 '11 at 0:47
  • Its working now. – abc Dec 10 '11 at 0:47

You can use SendEmail as well

  • Can you give me the commandline options to do that ? I tried that also but it does not seem to be working. – abc Dec 10 '11 at 0:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.