473,800 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 12 '05 #1
6 9640
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*******@postg resql.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 YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 12 '05 #7

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

Similar topics

1
1683
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 scripts. they are both in the same group. these php scripts start background processes, i can communicate with using signals (sending with posix_kill, starting background processes via pcntl_fork). so i got severel background processes owned by my 2...
1
1793
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 any site which gives instructions on how to replicate on REDHATLinux 8, Actually in postgresql.conf which is under /usr/local/pgsql/data/postgresql.conf, I added the following lines
11
2354
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 > /var/www/html/crohns/phpBB2/db/postgres7.php on line 79 Your PHP doesn't have support for PostgreSQL. Look at phpinfo();
0
1205
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. Decimail's unique feature is that mailboxes are defined using SQL queries. So for example you can match all messages to this list with this query:
11
3622
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 due to missing test-and-set code for ia64? I saw a disputed/repudiated ViSolve patch, but nothing else. Is this still broken? Here's my attempt on 8.0.0beta1: $uname -a
7
2321
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 datatypes do not match
1
7214
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 and still get into postgresql. I started the postmaster as a FreeBSD user named pgsql by running postmaster -i -D /usr/local/pgsql/data I changed postgresql's pgsql user account to have a new password via pgadmin3 too. But I can still log in to...
1
2486
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 narrowed down the Apache Client Cert failures to my PHP/PGSQL build. 1. Apache PHP without PGSQL works as expected using client certificates 2. Apache PHP with PGSQL works fine with standard SSL connections 3 Apache PHP with PGSQL fails with...
0
1929
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: pgsql_connect (4.3.11) So I figured whatev, I'll put a new installation (PHP5, in fact), but I always fail config with: Cannot find libpq-fe.h. Please specify correct Postgresql installation path
0
9690
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10501
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10250
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.