Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Hi All

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)

Alas, the problem is that while the script works perfectly on the workstation, it dies with the above error on the server.

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!

Here is the code:

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\" <me\@here.com>"; 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->new( From => $from, 'Reply-to' => $from, To => $to, Subject => $subject, Type =>'multipart/related' ) or die "Cannot create a new email instance!"; $msg->attach(Type => 'TEXT', Data => $message, ) or die "Error adding TXT: $!\n"; $msg->attach(Type => 'aplication/pdf', Path => $path, Disposition => 'attachment' ) or die "Error adding PDF: $!\n"; MIME::Lite->send('smtp','smtp.gmail.com',AuthUser=>$un, AuthPass=>$p +w, Timeout => 60); $msg->send(); return 0; }

Here is the output on the workstation:

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

and here is the output on the server:

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

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.

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).

Any guidance on how to fix this would be appreciated.

Thanks

Ted


In reply to MIME::Lite error => SMTP auth() command not supported on smtp.gmail.com by ted.byers

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others about the Monastery: (5)
    As of 2014-12-25 16:01 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (160 votes), past polls