Unless you're doing something more complicated than the code you posted, you should probably use the MailMsg method instead of manually calling Body and SendLineEnc. Here is your posted code using MailMsg:

#!/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; die "Error: $Mail::Sender::Error\n" unless ref $sender; my $result = $sender->MailMsg( smtp => $smtp, to => $from, from => $ticketad, #fake_from => $ticketad, subject => "Reply from mydomain for TEST", headers => "Errors-To: postmaster\@mydomain.com"}); msg => <<'*END*', Your support request has been received by mydomain Staff Support and will 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 particular issue. 2) All email should be directed to vgsupport\@mydomain.com for tracking purposes. -------------------- -------------------- Thank you, mydomain Staff Support *END* ); die "Error: $Mail::Sender::Error\n" unless ref $result; ref($sender->Close()) or die "Failed to send the message: $Mail::Sender::Error\n";

As to why your code isn't working, I'm guessing (and this is only a guess), that someone, somewhere (server or Mail::Sender) is getting confused by the mix of local newlines in the message body and the network newline at the end. Either that, or the socket is getting closed in some strange way that is not apparent from this code. *shrug*

bbfu
Black flowers blossom
Fearless on my breath


In reply to Re: New Mail::Sender not working? by bbfu
in thread 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.