Thread Problem mit Abfrage (2 answers)
Opened by Gast at 2004-05-18 18:26

renee
 2004-05-19 01:32
#2481 #2481
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
my $pop = Net::POP3->new($params{server}) or die $!;
my $msg_nums = $pop->login($params{user}, $params{pwd});

if ($msg_nums > 0) {
### E-Mail enthalten ###
   my $msgnums = $pop->list; # hashref of msgnum => size
   foreach my $msgnum (sort{$a <=> $b} keys %$msgnums){
my $lines = join("",@{$pop->get($msgnum)});
     my ($head,$body) = split(/\n\s+?\n/,$lines,2);
     my @headlines = split(/\n/,$head);
     my ($subject,$from);
     foreach(@headlines){
       $subject = $1 if($_ =~ m/Subject:\s+?(.+)/i);
       $from = $1 if($_ =~ m/From:\s+?(.+)/i);
     }
 }
}
else{
print "Keine E-Mails";
}
\n\n

<!--EDIT|renee|1084916051-->
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread Problem mit Abfrage