This article describes how to send mail to GPDB using plperlu.
Follow these steps:
/etc/rc.d/init.d/sendmail start
/etc/resolv.conf
Create or replace function sendmail() returns integer as
'
#!/usr/bin/perl
use Net::SMTP;
my ($sendTo,$sendFrom, $Subject, $Message)=(''[email protected]'',''[email protected]'', ''Hello Subject'',''Hello Message'');
my $smtp=Net::SMTP->new("localhost");
$smtp->mail($sendFrom);
$smtp->recipient($sendTo);
$smtp->data();
$smtp->datasend("To: $sendTo\n");
$smtp->datasend("Subject: $Subject\n");
$smtp->datasend("Content-Type: text/plain;\n\n");
$smtp->datasend("$Message\n");
$smtp->dataend();
$smtp->quit();
return 1;
'
language 'plperlu';
select sendmail();
sendmail
----------
1