version 1.223, 2009/03/29 20:05:06
|
version 1.225, 2010/03/02 15:10:47
|
Line 453 sub sendemail {
|
Line 453 sub sendemail {
|
"*** ".&mt_user($user_lh,'This is an automatic e-mail generated by the LON-CAPA system.')."\n". |
"*** ".&mt_user($user_lh,'This is an automatic e-mail generated by the LON-CAPA system.')."\n". |
"*** ".($senderaddress?&mt_user($user_lh,'You can reply to this e-mail'):&mt_user($user_lh,'Please do not reply to this address.')."\n*** ". |
"*** ".($senderaddress?&mt_user($user_lh,'You can reply to this e-mail'):&mt_user($user_lh,'Please do not reply to this address.')."\n*** ". |
&mt_user($user_lh,'A reply will not be received by the recipient!'))."\n\n".$body; |
&mt_user($user_lh,'A reply will not be received by the recipient!'))."\n\n".$body; |
|
|
|
$body =~ s/ / /g; |
|
|
my $msg = new Mail::Send; |
my $msg = new Mail::Send; |
$msg->to($to); |
$msg->to($to); |
$msg->subject('[LON-CAPA] '.$subject); |
$msg->subject('[LON-CAPA] '.$subject); |
Line 562 to access the full message.',$url);
|
Line 565 to access the full message.',$url);
|
|
|
sub mynewmail{ |
sub mynewmail{ |
&newmail(); |
&newmail(); |
return $env{'user.mailcheck.status'}; |
return $env{'user.mailcheck.lastnewmassagetime'} > $env{'user.mailcheck.lastvisit'}; |
} |
} |
|
|
|
|
Line 570 sub newmail {
|
Line 573 sub newmail {
|
if ((time-$env{'user.mailcheck.time'})>300) { |
if ((time-$env{'user.mailcheck.time'})>300) { |
my %what=&Apache::lonnet::get('email_status',['recnewemail']); |
my %what=&Apache::lonnet::get('email_status',['recnewemail']); |
&Apache::lonnet::appenv({'user.mailcheck.time'=>time}); |
&Apache::lonnet::appenv({'user.mailcheck.time'=>time}); |
&Apache::lonnet::appenv({'user.mailcheck.status'=> $what{'recnewemail'}>0 ? 1 : 0}); |
&Apache::lonnet::appenv({'user.mailcheck.lastnewmassagetime'=> $what{'recnewemail'}}); |
if ($what{'recnewemail'}>0) { return 1; } |
if ($what{'recnewemail'}>0) { return 1; } |
} |
} |
return 0; |
return 0; |