Search Postgresql Archives

Re: Send email from PostgreSQL, may I ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
On Fri, 2006-10-27 at 11:11 +0000, Gerson Machado wrote:
> I need send email directly from PG with on function, where locate
> this ?

You can send e-mails via pltclu or plperlu, more is also possible.

http://sourceforge.net/projects/pgmail/ <- This is tcl one.

plperlu one is attached. I don't remember where I got this one.

Regards,
-- 
The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, plPerlNG - http://www.commandprompt.com/

create or replace function mymail() returns integer as '

 #!/usr/bin/perl
  my ($sendTo, $Subject, $Message)=(''mymail ( at ) mail ( dot ) de'', ''TESTSubject'',''TESTMSG'');
  use Net::SMTP;
  my $smtp=Net::SMTP->new("localhost");

  $smtp->mail("frommail\ ( at ) mail ( dot ) de");
  $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 and somethning TEST else \n");
  $smtp->dataend();
  $smtp->quit();
  return 1;
' language 'plperlu';

Attachment: signature.asc
Description: This is a digitally signed message part


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux