I'm searching a way to send emails via MySql, similar to using dbmail in SQL Server.
I am writing a query to be emailed every week but for the life of me I cannot find any information on sending emails using only MySQL. All solutions I've come across uses php to send the actually email, which I don't think I'd want seeing as I want to schedule it to send an email every week.
Is it possible to send emails via mySQL?
Is there a better way to implement this?
Any help is appreciated.
Thanks.
Development Tools: WAMP Server, MySQL Workbench
You could create a batch/Powershell script that executes on a schedule (using the Windows scheduling assistant).
Whilst this isn't the way I'd perhaps do it (Maybe a PHP Cron Job for example) - it is certainly a way of doing it without PHP
Is there a reason you don't want to use PHP?
Thanks,
To Schedule events on MySQL you can flow this tutorial.
http://www.sitepoint.com/how-to-create-mysql-events/
To send e-mail you can use MySQL UDF (https://github.com/mysqludf)
Here is a tutorial
http://dailypaper.in/technical/how-to-send-email-from-a-mysql-trigger-in-linux/
hope this can help you
Related
Is there is way to send email when query executed manually in mysql server. Can we do this in mysql trigger please advise me how do we get email when some query run in mysql
please don't try to do that...
MySQL is a pure Database it's not its business to send eMails.
MySQL has no eMail functionality ether.
i'd recommend creating a new table and write a tuple in that table when the procedure is used.
Then poll that table (with a java application or so) and send the mail
MySQL is just a database solution, where you can store and retrieve data. For query, you may use a server side scripting like PHP. Then using php, while doing a query, you may send emails. Set up email in your server to send to an id while mysql data is retrieved.
I'm building a simple commenting system using node and i need to configure this in a PHP project running in Apache server. So, i need to trigger node.js when some changes made in MySQL database table present in the Apache server. So, i need to know whether it is possible to do this in a Apache server? If so, then how to do that? Any idea or suggestions on this are greatly welcome. Please help...
I guess there are few options you could take, but I don't think you can get some sort of triggered action from within MySQL or Apache. IMHO, you these are the approaches you can take:
you can expose a HTTP API from node and every time you need to notify the node app, you could simply insert the data into MySQL using PHP and then issue a simple GET request to trigger node.
You could use some sort of queuing system (rabbitmq, redis, etc.) to manage the messages to and from the two application, hence orchestrating the flow of the data between the two apps (and later the db).
you could poll the database from node and check for new rows to be available. This is fairly inefficient and quite tricky, but it sounds more close to what you want.
I'd like to run a script, typically in PHP or MySQL since it involves changing a Mysql db table when an email arrives at my exchange server (2010).
The server holds IIS7.
So in short:
Email->Exchange server->changes a table in MySQL DB
Notes:
Not looking for a script that connects to the e-mail via POP/imap
I'm looking for a kind of trigger that occurs in the server
Webservices or Transport Agent seem complicated If you can supply an easy example I'll accept it.
If you have a Sink example that runs on Exchange 2010 please support it with careful explanation and examples/links. (step by step if you have to)
Other scripting languages accepted.
Possibly not exactly what you are looking for but Postmark offer an incoming mail service that allows you to do this kind of thing.
Their API is pretty good and very well documented. My understanding is you can set up webhooks that will allow you to do what you're looking for.
I hope this is some use to you.
Is there any mail packages available in mysql?
I am using phpmyadmin tool to manage mysql Db.
I want to send email using stored-procedures in mysql.
No there is not and You should not do this because it can affect mysql performance.
My advice is to write a simple script that send e-mails according to data from table.
at an application I'm working on users can forward their email-accounts to an address from our system (something like email#userid.amazingstuff.com ). It doesn't matter here why they should do this, but I need some professional advice on the best way to approach this.
The basic idea is that our mailserver receives the incoming (forwarded) mails and a mailpoller (which runs in a loop) downloads the mails from the mailserver, processes them (get the text, assigns them to an account, etc.) and saves them via an "IncomingMail" ActiveRecord Model.
But I'm not sure how the poller should connect the server? Via Imap / Pop? Or should I store the mails on the mailserver with MySQL and connect to the DB directly? Or is this a bad idea?
I need a fast, reliable and scaleable system.
Thanks for your advice!
Update
I think a DB like MySQL is always faster than parsing a file system. It should also be easily scaleable. I'm no thinking about using DBMail (http://www.dbmail.org/). Has anyone any experience using this solution? Or any further hints / comments?
Thanks!
Pop should work, check out some example code here:
http://www.ruby-doc.org/stdlib/libdoc/net/pop/rdoc/classes/Net/POP3.html