D
dn.perl
I can send email from my linux server with 'mailx' command. I could
also send an email from it using Mime::Lite module until recently.
Today the same old working module has started failing, and it gives an
error: Illegal Seek.
What could be happening?
The mailx cmd runs well: mailx -s "subject1 sub 2"
(e-mail address removed) <aaa
cmd: ./local-send-mail-test.pl
The error:
rv = 1, Illegal seek
An email, with subject: (sample subject), has been sent to myname-etc-
etc
Code as below : (You will need to edit the line marked 'edit-this-
line' before running it.
#!/usr/local/bin/perl
use strict ;
use warnings ;
use MIME::Lite;
my $my_email = '(e-mail address removed)' ; ## edit-this-line
my $subject = 'sample subject' ;
my $message = "line 1, line 1" ;
my $msg_body_type = 'text' ;
my $msg = MIME::Lite->new(
From=>$my_email,
To => "$my_email",
Subject => $subject,
Type => 'multipart/related',
);
$msg->attach(
Type => $msg_body_type, #-# text/html or text
Data => $message
);
my $rv = $msg->send() ;
print "rv = $rv, $! \n\nAn email, with subject: ($subject), has been
sent to $my_email\n\n" ;
##=============
also send an email from it using Mime::Lite module until recently.
Today the same old working module has started failing, and it gives an
error: Illegal Seek.
What could be happening?
The mailx cmd runs well: mailx -s "subject1 sub 2"
(e-mail address removed) <aaa
cmd: ./local-send-mail-test.pl
The error:
rv = 1, Illegal seek
An email, with subject: (sample subject), has been sent to myname-etc-
etc
Code as below : (You will need to edit the line marked 'edit-this-
line' before running it.
#!/usr/local/bin/perl
use strict ;
use warnings ;
use MIME::Lite;
my $my_email = '(e-mail address removed)' ; ## edit-this-line
my $subject = 'sample subject' ;
my $message = "line 1, line 1" ;
my $msg_body_type = 'text' ;
my $msg = MIME::Lite->new(
From=>$my_email,
To => "$my_email",
Subject => $subject,
Type => 'multipart/related',
);
$msg->attach(
Type => $msg_body_type, #-# text/html or text
Data => $message
);
my $rv = $msg->send() ;
print "rv = $rv, $! \n\nAn email, with subject: ($subject), has been
sent to $my_email\n\n" ;
##=============