public inbox for [email protected]
help / color / mirror / Atom feedsending mail from Postgres
5+ messages / 4 participants
[nested] [flat]
* sending mail from Postgres
@ 2005-12-28 03:22 Aftab Alam <[email protected]>
2005-12-28 04:30 ` Re: sending mail from Postgres Jeremy Drake <[email protected]>
2005-12-28 05:20 ` Re: sending mail from Postgres Pavel Stehule <[email protected]>
2005-12-29 04:53 ` Re: sending mail from Postgres David Fetter <[email protected]>
0 siblings, 3 replies; 5+ messages in thread
From: Aftab Alam @ 2005-12-28 03:22 UTC (permalink / raw)
To: [email protected]
Hi there,
How can i send mail form postgresql.
any suggestion.
thanx & regards
aftab
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: sending mail from Postgres
2005-12-28 03:22 sending mail from Postgres Aftab Alam <[email protected]>
@ 2005-12-28 04:30 ` Jeremy Drake <[email protected]>
2 siblings, 0 replies; 5+ messages in thread
From: Jeremy Drake @ 2005-12-28 04:30 UTC (permalink / raw)
To: Aftab Alam <[email protected]>; +Cc: [email protected]
Code from perl cookbook, wrapped in plperlu wrapper
not very portable, Net::SMTP would probably be better, and result in more
portable perl code.
Didn't test this - but it is copied straight from perl cookbook via
google: http://www.unix.org.ua/orelly/perl/cookbook/ch18_04.htm
CREATE OR REPLACE FUNCTION send_email(from_address text, to_address text,
subject text, body text) RETURNS void AS $$
use Mail::Mailer;
my ($from_address, $to_address, $subject, $body) = @_;
my $mailer = Mail::Mailer->new("sendmail");
$mailer->open({ From => $from_address,
To => $to_address,
Subject => $subject,
})
or die "Can't open: $!";
print $mailer $body;
$mailer->close();
$$ LANGUAGE plperlu VOLATILE STRICT;
On Wed, 28 Dec 2005, Aftab Alam wrote:
> Hi there,
>
> How can i send mail form postgresql.
>
> any suggestion.
>
> thanx & regards
> aftab
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
--
Don't steal; thou'lt never thus compete successfully in business. Cheat.
-- Ambrose Bierce
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: sending mail from Postgres
2005-12-28 03:22 sending mail from Postgres Aftab Alam <[email protected]>
@ 2005-12-28 05:20 ` Pavel Stehule <[email protected]>
2 siblings, 0 replies; 5+ messages in thread
From: Pavel Stehule @ 2005-12-28 05:20 UTC (permalink / raw)
To: [email protected]; [email protected]
Hello,
it depend on your possibilities. Simply, use PL/Perl or PL/sh.
Regards
Pavel Stehule
or use PgSendMail
http://sourceforge.net/project/showfiles.php?group_id=35804
>
>Hi there,
>
>How can i send mail form postgresql.
>
>any suggestion.
>
>thanx & regards
>aftab
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: explain analyze is your friend
_________________________________________________________________
Citite se osamele? Poznejte nekoho vyjmecneho diky Match.com.
http://www.msn.cz/
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: sending mail from Postgres
2005-12-28 03:22 sending mail from Postgres Aftab Alam <[email protected]>
@ 2005-12-29 04:53 ` David Fetter <[email protected]>
2 siblings, 0 replies; 5+ messages in thread
From: David Fetter @ 2005-12-29 04:53 UTC (permalink / raw)
To: Aftab Alam <[email protected]>; +Cc: [email protected]
On Wed, Dec 28, 2005 at 08:52:41AM +0530, Aftab Alam wrote:
> Hi there,
>
> How can i send mail form postgresql.
Generally, it is a better idea either to poll your PostgreSQL database
and send mail based on that, or use LISTEN/NOTIFY, rather than
directly sending mail from your database.
Cheers,
D
--
David Fetter [email protected] http://fetter.org/
phone: +1 415 235 3778
Remember to vote!
^ permalink raw reply [nested|flat] 5+ messages in thread
* sending mail from Postgres
@ 2005-12-28 03:22 Aftab Alam <[email protected]>
0 siblings, 0 replies; 5+ messages in thread
From: Aftab Alam @ 2005-12-28 03:22 UTC (permalink / raw)
To: pgsql-docs
Hi there,
How can i send mail form postgresql.
any suggestion.
thanx & regards
aftab
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2005-12-29 04:53 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-12-28 03:22 sending mail from Postgres Aftab Alam <[email protected]>
2005-12-28 04:30 ` Jeremy Drake <[email protected]>
2005-12-28 05:20 ` Pavel Stehule <[email protected]>
2005-12-29 04:53 ` David Fetter <[email protected]>
2005-12-28 03:22 sending mail from Postgres Aftab Alam <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox