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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |