Hi,
Add the send_mail subroutine in Home.pm
$COMPILE{send_mail} = <<'END_OF_SUB';
sub send_mail {
#-----------------------------------------------------------------------------
#
my $self = shift;
use GT::Mail;
# Create and Sending
my $msg = $self->{cgi}->{msg} || 'Whatever';
my $to = $self->{cgi}->{to};
my $from = $self->{cgi}->{from};
my $sbj = $self->{cgi}->{sbj};
GT::Mail->send (
'Content-type' => 'text/html',
sendmail => $self->{glb_cfg}->{db_mail_path},
to => $to,
from => $from,
subject => $sbj,
msg => $msg
) or die "Error: $GT::Mail::error";
return ('home.html',{
header => $self->_language('HEA_HOME'),
msg => 'Email was sent.'});
}
END_OF_SUB
And then, add a link db.cgi?db=<%db%>&do=send_mail&msg=.....
Or you can create a plugin for this, that should be better because it won't lose when you upgrade DBMan SQL.
Hope that helps,
TheStone.
B.
Add the send_mail subroutine in Home.pm
$COMPILE{send_mail} = <<'END_OF_SUB';
sub send_mail {
#-----------------------------------------------------------------------------
#
my $self = shift;
use GT::Mail;
# Create and Sending
my $msg = $self->{cgi}->{msg} || 'Whatever';
my $to = $self->{cgi}->{to};
my $from = $self->{cgi}->{from};
my $sbj = $self->{cgi}->{sbj};
GT::Mail->send (
'Content-type' => 'text/html',
sendmail => $self->{glb_cfg}->{db_mail_path},
to => $to,
from => $from,
subject => $sbj,
msg => $msg
) or die "Error: $GT::Mail::error";
return ('home.html',{
header => $self->_language('HEA_HOME'),
msg => 'Email was sent.'});
}
END_OF_SUB
And then, add a link db.cgi?db=<%db%>&do=send_mail&msg=.....
Or you can create a plugin for this, that should be better because it won't lose when you upgrade DBMan SQL.
Hope that helps,
TheStone.
B.