title: MIME::Lite not working with SMTP
body: <p>I have been using <a href="https://metacpan.org/pod/MIME::Lite" rel="nofollow noreferrer"><code>MIME::Lite</code></a> for a while to send to my mailing list without any problems, but have recently decided to use SMTP authentication as I've heard it's better for email source verification.</p>
  
  <p>I can't get it to work. I checked for and installed the <a href="https://metacpan.org/pod/Net::SMTP" rel="nofollow noreferrer"><code>Net::SMTP</code></a> module which I understand <code>Mime::Lite</code> uses for this.</p>
  
  <p>Any ideas?</p>
  
  <p>Here's my code:</p>
  
  <pre><code>my $mailHost = 'mail.domain.com';
  my $user     = 'username';
  my $pass     = 'password';
  my $html     = 'someHTML';
  my $text     = 'someText';
  
  use MIME::Lite;
  
  MIME::Lite-&gt;send( 'smtp', $mailHost, AuthUser =&gt; $user, AuthPass =&gt; $pass );
  
  my $msg = MIME::Lite-&gt;new(
      From    =&gt; 'Mailing list &lt;list@domain.com&gt;',
      To      =&gt; $email,
      Subject =&gt; $subject,
      Type    =&gt; 'multipart/alternative'
  );
  
  $msg-&gt;attach(
      Type =&gt; 'TEXT',
      Data =&gt; $text
  );
  
  $msg-&gt;attach(
      Type =&gt; 'text/html',
      Data =&gt; $html
  );
  
  $msg-&gt;send();
  </code></pre>