E
eng.john84
The below code contain two modules POP3Client & Sendmail .
The POP3Client used to get the subject from the header as numbers.
The Sendmail used to send message to ( (e-mail address removed) ) .
The Problem how to print the subject from POP3Client to the email part
( (e-mail address removed)) at sendmail.
<code>
use Mail::Sendmail;
use Mail:
OP3Client;
$pop = new Mail:
OP3Client( USER => "xxxxxxxxxxx",
PASSWORD => "xxxxxxxxxxx",
HOST => "xxxxxxxxxxx" ),
TIMEOUT => 1;
for ($i = 1; $i <= $pop->Count(); $i++) {
foreach ( $pop->Head( $i ) ) {
/^Subject:.+\s(\d+)/i && print $1, "\n";
}
print "\n";
}
%mail = ( To => 'HOW TO PRINT THE SUBJECT(Numbers)
(e-mail address removed)',
From => 'xxxxxxxxxxxx',
Subject => 'xxxxxxxxx',
Message => 'John',
);
$mail{auth} = {user=>'xxxxxxxxx', password=>"xxxxxx", method=>"LOGIN",
required=>0 };
sendmail(%mail) or die $Mail::Sendmail::error;
print "OK. Log says:\n", $Mail::Sendmail::log;
</code>
The POP3Client used to get the subject from the header as numbers.
The Sendmail used to send message to ( (e-mail address removed) ) .
The Problem how to print the subject from POP3Client to the email part
( (e-mail address removed)) at sendmail.
<code>
use Mail::Sendmail;
use Mail:
$pop = new Mail:
PASSWORD => "xxxxxxxxxxx",
HOST => "xxxxxxxxxxx" ),
TIMEOUT => 1;
for ($i = 1; $i <= $pop->Count(); $i++) {
foreach ( $pop->Head( $i ) ) {
/^Subject:.+\s(\d+)/i && print $1, "\n";
}
print "\n";
}
%mail = ( To => 'HOW TO PRINT THE SUBJECT(Numbers)
(e-mail address removed)',
From => 'xxxxxxxxxxxx',
Subject => 'xxxxxxxxx',
Message => 'John',
);
$mail{auth} = {user=>'xxxxxxxxx', password=>"xxxxxx", method=>"LOGIN",
required=>0 };
sendmail(%mail) or die $Mail::Sendmail::error;
print "OK. Log says:\n", $Mail::Sendmail::log;
</code>