Re: Sending email from PL/pgSQL - Mailing list pgsql-novice

From Alan Hodgson
Subject Re: Sending email from PL/pgSQL
Date
Msg-id 1447585.KsiBEi0yGS@skynet.simkin.ca
Whole thread Raw
In response to Sending email from PL/pgSQL  (Jack Kaufman <jack.kaufman@sanmina.com>)
List pgsql-novice
On Wednesday, August 28, 2013 12:39:14 PM Jack Kaufman wrote:
> Would someone provide an example of how to send email from a PL/pgSQL
> function?
>
> Thanks in advance.
>
> Jack


I don't believe you can access anything external to PostgreSQL using PL/pgSQL.
You can create untrusted functions using other languages, though, like PL/Perl
or PL/Python, and use those languages' native libraries to send mail.

I wouldn't actually recommend doing so, though. I would suggest putting the
messages to be sent into a separate table and have an external script poll
that and send the mail as required.

Also, .jar files are for Java or Javascript, and are unlikely to have much to
do with your PostgreSQL installation.


pgsql-novice by date:

Previous
From: Jack Kaufman
Date:
Subject: Sending email from PL/pgSQL
Next
From: Andreas Kretschmer
Date:
Subject: Re: Sending email from PL/pgSQL