<?xml version="1.0" encoding="windows-1252"?>
<node id="925773" title="MIME::Lite error =&gt; SMTP auth() command not supported on smtp.gmail.com" created="2011-09-13 17:12:29" updated="2011-09-13 17:12:29">
<type id="115">
perlquestion</type>
<author id="925765">
ted.byers</author>
<data>
<field name="doctext">
&lt;p&gt;Hi All&lt;/p&gt;
&lt;p&gt;I have a particularly obscure and puzzling problem.  The following code works perfectly on my workstation (64 bit Windows 7, 64 bit Activestate perl 5.12).  I am trying to set the script up on a Server running Windows Server 2003 (but the same version of Perl - in fact, I copied the whole C:\Perl64 directory tree from the above workstation to the server, which happend very quickly over a 1GB LAN, and set up the environment variables appropriately)&lt;/p&gt;
&lt;p&gt;Alas, the problem is that while the script works perfectly on the workstation, it dies with the above error on the server.&lt;/p&gt;&lt;p&gt;I did do a search of this forum, and found information about 'use Authen::SASL qw(Perl);'.  Authen::SASL is in fact installed, and adding the use statement 'use Authen::SASL qw(Perl);' at the beginning of the script changes nothing!&lt;/p&gt;&lt;p&gt;Here is the code:&lt;/p&gt;
&lt;code&gt;use strict;
use MIME::Lite;

my $subject="A first MIME::Lite test on gmail";
my $message="A Daily PDF report is attached.Just to see if this works";

my $to = "r.ted.byers\@gmail.com";
my $file = "mysamplefile.pdf";
my $from = "\"Me\" &lt;me\@here.com&gt;";
print "Sending test email.\n";
make_and_send_email($from,$to,$subject,$message,$file);
print "Test email sent.\n";

sub make_and_send_email{
  my ($from, $to,$subject,$message, $path) =@_;
  my $un='myun';
  my $pw='mypwd';
  my $msg = MIME::Lite-&gt;new(
			    From =&gt; $from,
			    'Reply-to' =&gt; $from,
			    To =&gt; $to,
			    Subject =&gt; $subject,
			    Type    =&gt;'multipart/related'
			   ) or die "Cannot create a new email instance!";
  $msg-&gt;attach(Type =&gt; 'TEXT',
	       Data =&gt; $message,
	      ) or die "Error adding TXT: $!\n";
  $msg-&gt;attach(Type =&gt; 'aplication/pdf',
	       Path =&gt; $path,
	       Disposition =&gt; 'attachment'
	      ) or die "Error adding PDF: $!\n";
  MIME::Lite-&gt;send('smtp','smtp.gmail.com',AuthUser=&gt;$un, AuthPass=&gt;$pw, Timeout =&gt; 60);
  $msg-&gt;send();
  return 0;

}
&lt;/code&gt;
&lt;p&gt;Here is the output on the workstation:&lt;/p&gt;
&lt;pre&gt;
C:/Perl64/bin\perl.exe -w c:/Work/gmail.test.pl 
Sending test email.
Test email sent.

Compilation finished at Tue Sep 13 11:33:59
&lt;/pre&gt;
&lt;p&gt;and here is the output on the server:&lt;/p&gt;
&lt;pre&gt;
C:/Perl64/bin\perl.exe -w c:/Work/gmail.test.pl 
Sending test email.
SMTP auth() command not supported on smtp.gmail.com

Compilation exited abnormally with code 255 at Tue Sep 13 16:47:12
&lt;/pre&gt;
&lt;p&gt; Since I copied everything in C:\Perl64 on the workstation to the same location on the server (and set PERL_HOME to C:\Perl64 as an environment variable), what could possibly be different between the two machines that would account for the different outcomes?  Of course, I used the same credentials on both machines.&lt;/p&gt;&lt;p&gt;This is the first time I have shifted code from one machine to another only to find it breaking (and in fact I do this alot).&lt;/p&gt;&lt;p&gt;Any guidance on how to fix this would be appreciated.&lt;/p&gt;&lt;p&gt;Thanks&lt;/p&gt;&lt;p&gt;Ted&lt;/p&gt;</field>
</data>
</node>
