title: What is the difference between base64 and MIME base 64?
body: <p>I just spent way too much time banging my head against an SMTP server because it didn't like the base64 encoded credentials I was using. Turns out that when I chose NOT to use <code>perl</code> like so many instructions on the internet say to use, I was making a big mistake. Why is this? I thought base64 was a single standard.</p>
  
  <p>Consider:</p>
  
  <pre><code>$ perl -MMIME::Base64 -e 'print encode_base64("ASDF1234asdf")'
  QVNERjEyMzRhc2Rm
  
  $ base64 &lt;&lt;&lt;"ASDF1234asdf"
  QVNERjEyMzRhc2RmCg==
  
  $ python3.6 -m base64 &lt;&lt;&lt;"ASDF1234asdf"
  QVNERjEyMzRhc2RmCg==
  
  $ python2.7 -m base64 &lt;&lt;&lt;"ASDF1234asdf"
  QVNERjEyMzRhc2RmCg==
  
  $ perl -MMIME::Base64 -e "print encode_base64('my_user_name@my_domain.com')"
  bXlfdXNlcl9uYW1lQG15X2RvbWFpbi5jb20=
  
  $ base64 &lt;&lt;&lt;"my_user_name@my_domain.com"
  bXlfdXNlcl9uYW1lQG15X2RvbWFpbi5jb20K
  </code></pre>
  
  <p>So, <code>perl</code> is unique in its output and my server requires it that way.</p>
  
  <p>Why am I getting different results?</p>
  
  <p>How do you get the MIME/SMTP friendly output with something other than perl?</p>