Send Mail from sqlite

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Send Mail from sqlite

Vairamuthu
Hi

I like to know if there is any possible to send a mail from sqlite.

I wanted to know if there is option to configure smtp in sqlite, which will
help me to send a mail.

My requirement

I need to send a notification mail once the table is getting
updated/inserted/deleted.


Regards
Muthu
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Send Mail from sqlite

Simon Slavin-3

On 7 Feb 2014, at 9:51am, Vairamuthu <[hidden email]> wrote:

> Hi
>
> I like to know if there is any possible to send a mail from sqlite.

No it's not.  Sorry, you are going to have to do some programming.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Send Mail from sqlite

Vairamuthu
Thanks for your response, it will be great help if you can get me some
sample code or algorithms, on that.


On Fri, Feb 7, 2014 at 5:55 PM, Simon Slavin <[hidden email]> wrote:

>
> On 7 Feb 2014, at 9:51am, Vairamuthu <[hidden email]> wrote:
>
> > Hi
> >
> > I like to know if there is any possible to send a mail from sqlite.
>
> No it's not.  Sorry, you are going to have to do some programming.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



--
-- S.Vairamuthu
Secret of Success is Passion
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Send Mail from sqlite

Simon Slavin-3

On 7 Feb 2014, at 9:59am, Vairamuthu <[hidden email]> wrote:

> Thanks for your response, it will be great help if you can get me some
> sample code or algorithms, on that.

That would depend on what programming language you are using and what access it has to any method of sending mail.  However you do it, it won't be done inside SQLite so it won't be anything to do with this mailing list.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Send Mail from sqlite

Bart Smissaert
Not sure now if SQLite does events that can be picked up by your
application, but I use a VB wrapper (vbRichClient, written by Olaf Schmidt)
that does do SQLite events. If events can't be used then I presume you need
to poll the
database for changes.

RBS

On Fri, Feb 7, 2014 at 10:06 AM, Simon Slavin <[hidden email]> wrote:

>
> On 7 Feb 2014, at 9:59am, Vairamuthu <[hidden email]> wrote:
>
> > Thanks for your response, it will be great help if you can get me some
> > sample code or algorithms, on that.
>
> That would depend on what programming language you are using and what
> access it has to any method of sending mail.  However you do it, it won't
> be done inside SQLite so it won't be anything to do with this mailing list.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Send Mail from sqlite

Dominique Devienne
In reply to this post by Simon Slavin-3
On Fri, Feb 7, 2014 at 11:06 AM, Simon Slavin <[hidden email]> wrote:

> On 7 Feb 2014, at 9:59am, Vairamuthu <[hidden email]> wrote:
>
> > Thanks for your response, it will be great help if you can get me some
> > sample code or algorithms, on that.
>
> That would depend on what programming language you are using and what
> access it has to any method of sending mail.  However you do it, it won't
> be done inside SQLite so it won't be anything to do with this mailing list.


Right. And to get you started, assuming you are using SQLite from C/C++,
here are a few links:

http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol

http://libsmtp.berlios.de/
http://www.vmime.org/
http://curl.haxx.se/libcurl/c/smtp-tls.html
http://libsmtpc.nerdfeliz.com/
http://stackoverflow.com/questions/8995476/what-is-the-most-used-and-flexible-smtp-client-library-in-c-c

Otherwise many programming languages have this built-in as part of their
"standard library" or "frameworks", like Perl, Python, Java, .NET, Go,
etc... --DD
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Send Mail from sqlite

Kevin Martin
In reply to this post by Vairamuthu
On 7 Feb 2014, at 09:59, Vairamuthu <[hidden email]> wrote:

> Thanks for your response, it will be great help if you can get me some
> sample code or algorithms, on that.


I'm assuming you're using SQLite embedded within another application on something unix like.

Off the top of my head, here's how I would do it  - there may be an extension like this lying around somewhere already?

Create an SQLite3 extension that implements the following functions

sqlnotify_open(<name>, <unix_socket>, <template>)
sqlnotify_close(<name>)
sqlnotify_send(<name>, <arg1>, <arg2>, …)

The open function will connect to the specified socket, the close function will obviously close the connection.

When sqlnotify_send is called from your trigger, it will insert its arguments into the associated template and then send the resultant string to the socket.

Implement a daemon in your favourite language with a mail() function to send the mails. I wouldn't recommend that you send a mail for each notify, maybe save them up and send every 5 minutes or so.

PERL/Python are probably good choices for the daemon. As for writing the extension, it depends how you're using SQLite, but you're probably going to end up in C. I recommend chapter 9 of the book "Using Sqlite"

Thanks,
Kevin


_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Send Mail from sqlite

Vairamuthu
Thanks to all for the suggestion, will try my best to implement this
solution.



On Fri, Feb 7, 2014 at 6:28 PM, Kevin Martin <[hidden email]> wrote:

> On 7 Feb 2014, at 09:59, Vairamuthu <[hidden email]> wrote:
>
> > Thanks for your response, it will be great help if you can get me some
> > sample code or algorithms, on that.
>
>
> I'm assuming you're using SQLite embedded within another application on
> something unix like.
>
> Off the top of my head, here's how I would do it  - there may be an
> extension like this lying around somewhere already?
>
> Create an SQLite3 extension that implements the following functions
>
> sqlnotify_open(<name>, <unix_socket>, <template>)
> sqlnotify_close(<name>)
> sqlnotify_send(<name>, <arg1>, <arg2>, ...)
>
> The open function will connect to the specified socket, the close function
> will obviously close the connection.
>
> When sqlnotify_send is called from your trigger, it will insert its
> arguments into the associated template and then send the resultant string
> to the socket.
>
> Implement a daemon in your favourite language with a mail() function to
> send the mails. I wouldn't recommend that you send a mail for each notify,
> maybe save them up and send every 5 minutes or so.
>
> PERL/Python are probably good choices for the daemon. As for writing the
> extension, it depends how you're using SQLite, but you're probably going to
> end up in C. I recommend chapter 9 of the book "Using Sqlite"
>
> Thanks,
> Kevin
>
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



--
-- S.Vairamuthu
Secret of Success is Passion
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Send Mail from sqlite

Nelson, Erik - 2
In reply to this post by Simon Slavin-3
Simon Slavin wrote on Friday, February 07, 2014 5:06 AM
>> On 7 Feb 2014, at 9:59am, Vairamuthu <[hidden email]> wrote:
>> Thanks for your response, it will be great help if you can get me
>> some sample code or algorithms, on that.
>
> That would depend on what programming language you are using and what
> access it has to any method of sending mail.  However you do it, it
> won't be done inside SQLite so it won't be anything to do with this
> mailing list.


If SQLite is embedded in the app, might it be fairly simple to create a user defined function and call that from a trigger?

Erik

----------------------------------------------------------------------
This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer.   If you are not the intended recipient, please delete this message.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Send Mail from sqlite

Keith Medcalf
In reply to this post by Vairamuthu

Have your application that is performing the update send an email when it does an update/insert/delete.

>I like to know if there is any possible to send a mail from sqlite.
>
>I wanted to know if there is option to configure smtp in sqlite, which
>will help me to send a mail.
>
>My requirement
>
>I need to send a notification mail once the table is getting
>updated/inserted/deleted.




_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Send Mail from sqlite

KlaasV
In reply to this post by Vairamuthu
From: "Keith Medcalf" <[hidden email]>
Date: 7 Feb 2014 18:03:12 GMT+01:00
To: "General Discussion of SQLite Database" <[hidden email]>
Reply-To: General Discussion of SQLite Database <[hidden email]>



Have your application that is performing the update send an email when it does an update/insert/delete.

> I like to know if there is any possible to send a mail from sqlite.
>
> I wanted to know if there is option to configure smtp in sqlite, which
> will help me to send a mail.
>
> My requirement
>
> I need to send a notification mail once the table is getting
> updated/inserted/deleted.

It's very simple: let your application enter 'mailto:<name>@<domain>.<tld>' in the browser's URL-field

Kind regards|Cordiali saluti|Vriendelijke groeten|Freundliche Grüsse
Klaas `Z4us` V < Ar(Tos)It>
 

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Klaas "Z4us" V, MetaDBA at InnocentIsArt.EU