Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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\"; my $file = "mysamplefile.pdf"; my $from = "\"Me\" <me\>"; 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','',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/ 
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/ 
Sending test email.
SMTP auth() command not supported on

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.



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

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others romping around the Monastery: (4)
    As of 2018-03-18 14:36 GMT
    Find Nodes?
      Voting Booth?
      When I think of a mole I think of:

      Results (230 votes). Check out past polls.