473,394 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Sending email from PL/pgsql

Hey,

I was wondering if it is possible to send email from within PL/pgsql.
I'd like to do this to avoid code duplication in multiple frontends.
Can this be done somehow? Or do I have to write a C function for this
purpose? If so, how does one go about that?

Thanks,

--
Alexander Deruwe - ad*****@aqs-carcontrol.be
AQS-CarControl

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #1
6 9588
Alexander Deruwe wrote:
I was wondering if it is possible to send email from within PL/pgsql.
I'd like to do this to avoid code duplication in multiple frontends.
Can this be done somehow? Or do I have to write a C function for this
purpose? If so, how does one go about that?


You can write a postgresql function in C that calls libesmtp to send mails.

http://www.stafford.uklinux.net/libesmtp/

Shridhar
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #2
Hello

You can use PgSendMail

http://sourceforge.net/project/showf...group_id=35804

Pavel


On Thu, 30 Oct 2003, Alexander Deruwe wrote:
Hey,

I was wondering if it is possible to send email from within PL/pgsql.
I'd like to do this to avoid code duplication in multiple frontends.
Can this be done somehow? Or do I have to write a C function for this
purpose? If so, how does one go about that?

Thanks,

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #3
Alexander Deruwe wrote:
Hey,

I was wondering if it is possible to send email from within PL/pgsql.
I'd like to do this to avoid code duplication in multiple frontends.
Can this be done somehow? Or do I have to write a C function for this
purpose? If so, how does one go about that?


You can do it from pgperl and you can call a pgperl fruntion from pl/pgsql.


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #4
Hi,

Alexander Deruwe schrieb:
Hey,

I was wondering if it is possible to send email from within PL/pgsql.
I'd like to do this to avoid code duplication in multiple frontends.
Can this be done somehow? Or do I have to write a C function for this
purpose? If so, how does one go about that?


And to make it complete, now that plpython is unrestricted,
you can also use plpythonu for this tasks. Works very well
since this was one of the tests I had to make just after
I got my hands on plpythonu ;-)

For example including query results as attachment appeals to me.

Regards
Tino
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 12 '05 #5
On Thu, 2003-10-30 at 08:11, Tino Wildenhain wrote:
Hi,

Alexander Deruwe schrieb:
Hey,

I was wondering if it is possible to send email from within PL/pgsql.
I'd like to do this to avoid code duplication in multiple frontends.
Can this be done somehow? Or do I have to write a C function for this
purpose? If so, how does one go about that?


And to make it complete, now that plpython is unrestricted,
you can also use plpythonu for this tasks. Works very well
since this was one of the tests I had to make just after
I got my hands on plpythonu ;-)


Actually you guys left out pltclu which can do it, code can be found in
the cookbook:

http://www.brasileiro.net/postgres/c...?recipe_id=292

Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 12 '05 #6
Tino Wildenhain wrote:
Hi,

Alexander Deruwe schrieb:
Hey,

I was wondering if it is possible to send email from within PL/pgsql.
I'd like to do this to avoid code duplication in multiple frontends.
Can this be done somehow? Or do I have to write a C function for this
purpose? If so, how does one go about that?


And to make it complete, now that plpython is unrestricted,
you can also use plpythonu for this tasks. Works very well
since this was one of the tests I had to make just after
I got my hands on plpythonu ;-)


Complete? You forgot PL/TclU at least ;-)
Jan

--
#================================================= =====================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================= = Ja******@Yahoo.com #
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: rs035 | last post by:
good morning, everybody i know, it seems more to be a problem according to unix but i got it while developing software with php: i have 2 different users on a hp-ux machine that execute php...
1
by: Hema Sekhar | last post by:
Hi I am Hemasekhar K.P I am trying to replicae pgsql on REDHATLinux 8, but the site http://gborg.postgresql.org/genpage?replication_72install. is giving instructions on REDHATLinux 7, is there...
11
by: Daniel E. Fisher | last post by:
> I can't get a rest for a min guys. > > I go away for the weekend and my server is getting this error. > > Fatal error: Call to undefined function: pg_connect() in >...
0
by: Phil Endecott | last post by:
Dear PostgreSQL people, I thought that some of you might be interested to know about Decimail, a new IMAP mail server that I've written that uses PostgreSQL to implement its message store. ...
11
by: Ed L. | last post by:
Has anyone successfully built 7.3.4, 7.4.3, or 8.0.0beta1 on IA64 with HP-UX 11i v2 (11.23)? I'm not having any success, running into 'make' failures. Googling old posts suggests this might be...
7
by: snpe | last post by:
Is it down ? regards ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's...
1
by: John French | last post by:
I just installed postgresql 7.4.5 and pgadmin3 1.0.2 on FreeBSD and noticed that pgadmin allows the pgsql user to log in while ignoring the password. You can enter a wrong password or no password...
1
by: sysxperts | last post by:
Hello, Having an issue that is specific to PHP compiled with PGSQL support with versions noted in subject line. I understand that there are many variables to consider here but believe I have...
0
by: Matt | last post by:
I need an installation with Postgres support, and was happy to find in my phpinfo that there was a --with-pgsql=shared option in the config line. but I still got "call to undefined function:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.