Hello Pradeep,
The script is not yet working. I make some modification to the script to reflect my website parameters (:See the attached script). After that I transfered (in ASCII mode) the script (named indigos.cgi), POP3.pm and Parser.pm into the cgi directory on my website. I then chmod(UNIX)755 all the files.
I sent a message with header containing the expression "ultimate brochure" to
info@mywebsite.com. The message was sent from another email address from another webmail. Unfortunately I did not get any respondse-reply from info(at)mywebsite despite "ultimate brochure" in the header's line.
Is there any issue I am overlooking? Any help and enlighnment will be highly appreciated. Many thanks in advance.
Regards
Hans
Code:
#!/usr/bin/perl
use Net::POP3;
use MIME::Parser;
my $subscribe_subject = "ultimate brochure"; #added
my $pop = Net::POP3->new('mail.mywebsite.com', Timeout => 60); #modified
my $p = new MIME::Parser;
if ($pop->login('info@mywebsite.com', 'mysecretpassword') > 0)
{
my ($num,$size) = $pop->popstat;
for(my $i=1;$i<10;$i++)
{
my $m = join('',@{$pop->get($i)});
my $mo = $p->parse_data($m);
if($mo->head->get('Subject') =~ /$subscribe_subject/) #changed
{
my $msg = MIME::Lite->new(
From => 'info@mywebsite.com',
To => $mo->head->get('From'),
Subject => "Reply",
Type => 'text/plain',
Data => q[Hello, how are you?]
);
open( MAIL, "|/usr/sbin/sendmail -t" ) or warn($!);
print MAIL $msg->as_string;
close MAIL;
}
$pop->delete($i);
}
}
$pop->quit;