Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [Hank] Allow users to e-mail?

Quote Reply
Re: [Hank] Allow users to e-mail? In reply to
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
Subject Author Views Date
Thread Allow users to e-mail? Suomi 5955 Nov 12, 2001, 1:23 PM
Post Re: [Hank] Allow users to e-mail?
ktt 5811 Nov 13, 2001, 12:48 PM
Thread Re: [Hank] Allow users to e-mail?
604 5848 Nov 13, 2001, 1:32 PM
Post Re: [TheStone] Allow users to e-mail?
Suomi 5822 Nov 14, 2001, 6:40 AM
Post Re: [TheStone] Allow users to e-mail?
Suomi 5799 Nov 14, 2001, 7:58 AM
Thread Re: [TheStone] Allow users to e-mail?
Suomi 5847 Nov 14, 2001, 10:19 AM
Post Re: [Hank] Allow users to e-mail?
Suomi 5750 Nov 15, 2001, 8:59 PM
Thread Re: [TheStone] Allow users to e-mail?
Reena0330 5608 Sep 6, 2002, 3:58 PM
Thread Re: [Reena0330] Allow users to e-mail?
604 5612 Sep 6, 2002, 4:08 PM
Thread Re: [TheStone] Allow users to e-mail?
Reena0330 5603 Sep 6, 2002, 4:36 PM
Thread Re: [Reena0330] Allow users to e-mail?
604 5592 Sep 6, 2002, 4:55 PM
Post Re: [TheStone] Allow users to e-mail?
Reena0330 5582 Sep 7, 2002, 11:57 AM
Thread Re: [TheStone] Allow users to e-mail?
Reena0330 5547 Sep 12, 2002, 11:13 AM
Thread Re: [Reena0330] Allow users to e-mail?
Reena0330 5551 Sep 12, 2002, 5:59 PM
Post Re: [Reena0330] Allow users to e-mail?
Reena0330 5527 Sep 13, 2002, 4:25 PM