title: How to set up mail server(postfix or anything else) on ubuntu?
body: <p>I have installed Ubuntu Bionic on my virtual machine and have an application set up.</p>
  
  <p>Now what I need is to send emails from my own server.</p>
  
  <p>I am trying to set up postfix to do that but nothing works. I have tried many tutorials but still no success....even worse - the more tutorials I try the more confused I get.</p>
  
  <p>So what have I tried?</p>
  
  <ol>
  <li>I used <code>apt install mailutils</code> to install postfix and I chose <code>internet site</code> 
  When it asked for FQDM I entered <code>mydomain.com</code> . 
  Here  is the first question. Some tutorials say to change it to <code>mailmydomain.com</code> . 
  So is it supposed to be a subdomain?
  Do I need to create an A record to my DNS?</li>
  <li>The I try to send an email</li>
  </ol>
  
  <pre><code>email" | mail -s "This is the subject line" somemail@mail.com 
  </code></pre>
  
  <p>But nothing happens...no mail in my mailbox and no mails in posfix queue.</p>
  
  <ol>
  <li><p>Is there a step by step tutorial for a complete beginner?</p></li>
  <li><p>Do I need to create a MX record pointing to my server?</p></li>
  <li><p>Do I need to create a TXT record? I read that that is how other mail servers validate a sender. 
  If yes, then how to do it?</p></li>
  <li><p>So what do I have to do to send and email from my own server?
  At this point I don`t even need to receive and email - just send it</p></li>
  </ol>
  
  <p>And I don`t need to use postfix...I can use whatever works.</p>