Home : Products : DBMan SQL : Discussion :

Products: DBMan SQL: Discussion: Re: [Hank] Allow users to e-mail?: Edit Log

Here is the list of edits for this post
Re: [Hank] Allow users to e-mail?
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.

Last edited by:

TheStone: Nov 13, 2001, 1:34 PM

Edit Log: