I upgraded to Perl 5.8.0 then installed a new Mail::Sender v 0.8.06. This code was working but now it is not:

#!/usr/bin/perl -w use strict; use warnings; use Mail::Sender; my $smtp = "mail"; my $from = "nwatson\@mydomain.com"; my $ticketad = "fakefrom\@mydomain.com"; my $sender = new Mail::Sender; $sender->Open({ smtp =>$smtp, to =>$from, from =>$ticketad, #fake_from =>$ticketad, subject =>"Reply from mydomain for TEST", headers => "Errors-To: postmaster\@mydomain.com"}); die "Error: $Mail::Sender::Error\n" unless ref $sender; $sender->Body; $sender->SendLineEnc(<<"*END*"); Your support request has been received by mydomain Staff Support and w +ill be tracked as specified in the subject line of this email. When contacting us regarding this issue: 1) Please use the above subject line, or, ensure the full ticket ID, e +.g. is included in the subject line, for any emails regarding this pa +rticular issue. 2) All email should be directed to vgsupport\@mydomain.com for trackin +g purposes. -------------------- -------------------- Thank you, mydomain Staff Support *END* $sender->Close or die "Failed to send the message: $sender->{error_msg +}, $Mail::Sender::Error\n";

The script is returning this error: Failed to send the message: Connection not established, Connection not established

On the SMTP side this is in syslog:

collect: premature EOM: Error 0 collect: unexpected close on connection from endor.mydomain.com,

Anyone have any idea?

Neil Watson
watson-wilson.ca


In reply to New Mail::Sender not working? by neilwatson

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!
  • 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, details, 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, summary, 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.