Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

You have [n] messages!

Quote Reply
You have [n] messages!
Is it easy/possible to have some code on an ordinary .htm page which checks the status of webmail to see if there are any new messages and prints:

"You have [n] new messages"

Has this been done before, or can anyone help out please?

Quote Reply
Re: You have [n] messages! In reply to
Yep - here's a little PERL script that I use. I call this through a SSI call. Make sure the path to your Webmail.pm is correct...

Code:
#!/usr/local/bin/perl

#require "/cgi-bin/webmail/admin/Webmail.pm";

use strict;
use lib '.';
use Path_Config;
use Webmail;
use Webmail::Authenticate;
use CGI::Carp qw/fatalsToBrowser/;

my $information = '';
my $summary = '';
my $key = '';
my $value = '';
my $new = 0;

&Webmail::initialize();
my ($in, $user, $dbh) = &Webmail::init();

if ($user->{userid} && !($user->{is_active} eq 'No')) {

$summary =( &Webmail::load_summary());
while ( ($key, $value) = each %{$summary}){
if ($key eq 'new'){
$new = $value;
}
}
}

if ($new > 0){
$information = "You have $new new emails";
}
print "Content-type: text/html\n\n";
print "$information";
Safe swoops
Sangiro
http://www.dropzone.com/
Quote Reply
Re: You have [n] messages! In reply to
Sangiro,

thank you very much for helping me out. This is what the 'Net is all about! I wish you very good luck :-))