1022: return $self;
DB<15> x $self
0 Mail::Sender=HASH(0x2b06c40)
'authid' => 'webmaster@mydomain.org'
'authpwd' => 'thepassword'
'boundary' => 'Message-Boundary-by-Mail-Sender-1377721215'
'client' => 'hostnnn.hostmonster.com'
'debug' => 1
'from' => 'webmaster@mydomain.org'
'fromaddr' => 'webmaster@mydomain.org'
'keepconnection' => 1
'multipart' => 'mixed'
'on_errors' => 'code'
'port' => 465
'proto' => 6
'reply' => 'info@mydomain.org'
'replyaddr' => 'info@mydomain.org'
'smtp' => 'mail.mydomain.org'
'smtpaddr' => 'J?ϱ'
'tls_allowed' => 1
####
1322: my $s = $self->{'socket'} || $self->Connect();
DB<3> x $self
0 Mail::Sender=HASH(0x237e5f0)
'_had_newline' => 1
'authid' => 'webmaster@mydomain.org'
'authpwd' => 'therightpassword'
'boundary' => 'Message-Boundary-by-Mail-Sender-1377722649'
'client' => 'abcdefg.hostserver.com'
'debug' => 1
'from' => 'webmaster@mydomain.org'
'fromaddr' => 'webmaster@mydomain.org'
'keepconnection' => 1
'multipart' => 0
'on_errors' => 'code'
'port' => 465
'proto' => 6
'reply' => 'info@mydomain.org'
'replyaddr' => 'info@mydomain.org'
'smtp' => 'mail.mydomain.org'
'smtpaddr' => 'J?ϱ'
'subject' => 'smtp-ssl-auth test with Mail Sender module'
'tls_allowed' => 1
'to' => 'devmail@mydomain.org'
'to_list' => ARRAY(0x1eecbe0)
0 'devmail@mydomain.org'
####
#!/usr/bin/perl
use strict;
use warnings;
use Mail::Sender;
## use Carp ();
## local $SIG{__WARN__} = \&Carp::cluck;
BEGIN {
my $b__dir = (-d '/home2/avantclo/perl'?'/home2/avantclo/perl':( getpwuid($>) )[7].'/perl');
unshift @INC,$b__dir.'5/lib/perl5',$b__dir.'5/lib/perl5/x86_64-linux-thread-multi',map { $b__dir . $_ } @INC;}
my $user = 'webmaster@mydomain.org';
my $pass = 'TheRightPassword';
my $mlserver='mail.mydomain.org';
my $replyaddey='info@mydomain.org';
my $smtpaddey= 'localhost';
my $to='devmail@mydomain.org';
my $from_name='Webmaster';
my $from_email='webmaster@mydomain.org';
my $subject='smtp-ssl-auth test with Mail Sender module';
my $html="Test HTML content";
my $debugon = 1;
my $debugoff = 0;
my $portnum = 465;
my $errorset = "code";
my $keepconn = 1;
my $tlsreq = 1;
$Mail::Sender::NO_X_MAILER = 1;
open my $DEBUG, ">> ../../test/testsender1debugfile.txt"
or die "Can't open the debug file: $!\n";
my $smtps = Mail::Sender->new({
smtp=>($mlserver),
port=>($portnum),
authid=>($user),
authpwd=>($pass),
from=>($from_email),
reply=>($replyaddey),
debug=>($debugon),
on_errors => ($errorset),
keepconnection=>($keepconn),
TLS_allowed=>($tlsreq)});
$smtps->Open({
to=>($to),
from=>($from_email),
subject=>($subject)});
defined (ref $smtps) or die "Failed to open the message: $smtps->{'error_msg'}\n";
$smtps->SendLineEnc($html);
$smtps->SendLineEnc("This will be the body of the message.\n");
$smtps->SendLineEnc("\n--\nVery Official Looking .sig here\n");
if ($Mail::Sender::Error eq '') {
print "Test message has been sent\n";
} else {
die "Failed to send the message: $smtps->{'error_msg'}\n";
}
$smtps->Close();