title: Trying to send authenticated email using Net::SMTP::SSL
body: <p>I'm attempting to send an authenticated email with the Net::SMTP::SSL module to a comcast email server. I'm using the following code.</p>
  
  <pre><code>#!/usr/bin/perl
  
  use Net::SMTP::SSL;
  use MIME::Base64;
  
  $smtp = Net::SMTP::SSL-&gt;new
      (
      "smtp.comcast.net",
      Hello =&gt; "host.comcast.net",
      Port =&gt; 465,
      Timeout =&gt; 30,
      Debug =&gt; 1,
      );
  $smtp-&gt;datasend("AUTH LOGIN\n");
  $smtp-&gt;response();
  
  # Mailbox info
  $smtp-&gt;datasend(encode_base64('username')); # username
  $smtp-&gt;response();
  $smtp-&gt;datasend(encode_base64('password')); # password
  $smtp-&gt;response();
  
  # Email from
  $smtp-&gt;mail('user\@comcast.net');
  
  # Email to
  $smtp-&gt;to('user\@host.com');
  
  $smtp-&gt;data();
  
  $smtp-&gt;datasend("To: user\@host.com\n");
  $smtp-&gt;datasend("From: user\@comcast.net\n");
  $smtp-&gt;datasend("Subject: Test");
  
  # Line break to separate headers from body
  $smtp-&gt;datasend("\n");
  
  $smtp-&gt;datasend("Blah\n");
  $smtp-&gt;dataend();
  
  $smtp-&gt;quit();
  exit;
  </code></pre>
  
  <p>I'm basically following the code from <a href="https://stackoverflow.com/questions/2583987/how-to-use-perl-for-smtp-connection-with-user-and-ssl-auth-and-send-emails-with">here</a> for comcast.</p>
  
  <p>I've ran telnet and can connect to the smtp server on the port and I can issue the AUTH LOGIN and successfully login, but issuing the</p>
  
  <pre><code>$smtp-&gt;datasend("AUTH LOGIN\n");
  </code></pre>
  
  <p>always results in:</p>
  
  <pre><code>Can't call method "datasend" on an undefined value
  </code></pre>
  
  <p>I've also tried executing the auth method to login and that fails as well.</p>
  
  <p>What am I missing here?  I know it's something simple I'm overlooking.</p>