Thread: [GENERAL] Is there a way to Send attachments with email using pgmail postgreSQl?

Dear Sir/Mam,

I am also trying to send emails with attachments.please help me out with this.

Regards,
Nidhi

Hi

2016-12-16 7:07 GMT+01:00 nidhi raina <nidhiraina.12@gmail.com>:

Dear Sir/Mam,

I am also trying to send emails with attachments.please help me out with this.

You can use a untrusted Perl or Python functions



My warning - don't do it - Database is great for data manipulation, bad for communication. Some principles are hard to mix inside database. I like a stored procedures, all power of PostgreSQL, but the communication from database was failure early or in long time.

Better to write simple daemon application, that can monitor table with mails and sends mails related to new record there - you can use LISTEN/NOTIFY mechanism for immediate signal from database to application


Regards

Pavel

 

Regards,
Nidhi


On 12/15/2016 10:07 PM, nidhi raina wrote:
> Dear Sir/Mam,
>
> I am also trying to send emails with attachments.please help me out with

If as your subject suggests you are using this:

https://github.com/captbrando/pgMail

then it is not possible to send attachments:

"Essentially, pgMail is simply a stored function written in TCL
which takes 4 arguments of type 'text' (Who is it from, who is it
to, subject, and body of message), contacts the email server via
TCL sockets, and transmits your email (Now UTF-8 Compatible!).
"

> this.
>
> Regards,
> Nidhi
>


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: [GENERAL] Is there a way to Send attachments with email usingpgmail postgreSQl?

From
Alban Hertroys
Date:
> On 19 Dec 2016, at 18:55, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
>
> On 12/15/2016 10:07 PM, nidhi raina wrote:
>> Dear Sir/Mam,
>>
>> I am also trying to send emails with attachments.please help me out with
>
> If as your subject suggests you are using this:
>
> https://github.com/captbrando/pgMail
>
> then it is not possible to send attachments:
>
> "Essentially, pgMail is simply a stored function written in TCL
> which takes 4 arguments of type 'text' (Who is it from, who is it
> to, subject, and body of message), contacts the email server via
> TCL sockets, and transmits your email (Now UTF-8 Compatible!).
> "

Not even when you create the message with the correct MIME-headers and base64-encode your attachment within the correct
MIME-section?That's a fair amount of code to write, but a stored procedure in, say TCL, should be able to handle that.
Oram I missing something? 

Whether it's a good idea to let the database encode attachments and send e-mails is a different matter, but if it isn't
doingmuch beside that - well, why not? 

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.