Importing e-mails and attachments into a database - mysql

I've searched around a little bit and can't seem to find anything super useful on how to do this. I would like to be able to set up an email account which is able to receive emails and parse them into a database which will be useable later. What I would like would be to have a Database which linked the Sender, Subject, and attachment together at minimum, and maybe email the sender with an automated response if the database was successfully updated.
Thanks for any help you can provide in getting me started with this!

If you are mainly storing emails then you probably either want this: http://archiveopteryx.org or this: http://www.dbmail.org/
If you want to send emails with "commands" or "updates" for your database to process then read up on procmail and whatever MIME-parsing library your favourite language supports. Note that MIME can be fiddly, so allow time to understand the problem.

Related

"Send" code within a Send Message template

For many I'm sure, this is an easy fix but I've tried looking into it and to be quite honest, my knowledge of coding isn't like many of you. Having said that, I've downloaded a free template and I've been able to clean things up, make it my own except for one thing. When folks want to reach me, they add their name, number, email and message in the proper fields but when they hit "Send", I want their message and info to be sent to my email address. Can you please explain how this is done? I've attached the link so you can view.
http://landonmusicgroup.com/web3/contact.html#
Many thanks!
CL
As far as i understand, first u should note that sending email needs backend management, so first you should grap all form data, then should submit a form, and finally in backend u should check submitted data and execute sending email process

obfuscate json from webserver

I've got an android and iphone app that both get the required data from a webserver. The data is sent via json to the client. Using this setup other people might simply retrieve the url the app is calling and this way could make use of the data that I gather with my scripts on the server. To make it short: I don't want that :)
My idea is to make the json unreadable for example by encrypting it. This would make it a little harder to retrieve the information since this way some who would like to use my service would had to decompile the app an lookup any decryption stuff I had implemented.
Therefore two questions:
Do there exist some libraries that already offer such a functionality (Server side is Java)?
Does anyone of you have any other suggestions how I could protect my api from unwanted guests?
Thanks in advance :)
I think the options available would be...
to lock down the API to Authorized/Authenticated users.
Using BSON to obfuscate the data.
You could always use oAuth to allow the users to authenticate based on an account they already have: Facebook, Twitter, Google etc.

How to automatically respond to an e-mail

I would like to automatically respond to an e-mail with some information. The idea is to provide a self-service way for students to get grades and passwords. I see sample scripts that work on e-mails, but I need to:
look for a keyword in the subject to understand what type of information to provide (i.e., grade, password, etc.)
look at the e-mail of the inbound e-mail to identify the student (optionally locate a password)
look up the information (possibly in a spreadsheet)
create an e-mail and send it to the student
I am more familiar with using scripts with e-mail and spreadsheets, but I would prefer to create this on a Google Sites page or embed it in a wiki.
Thanks in advance for the help,
JDF
I am not sure how much detail you were looking for, or if you where looking for example code, but here are some high level things to think about.
First, if you are going to embed the code into a webpage that you want be able to access all your other Google things easaly. eg if i stored all the student names passwords and student numbers in an spreadsheet or database you have to set up permission to do so. Your website does not count as you "persay" because if you had it shared out then someone could potentally steal all your google stuff.
Take a good look through the Google appi google apps script. You can search your email by thread (subeject) and then go through the emails like that. I think all the function that you want are there.

Using email to update SQL database

Is it possible to use email to update mysql table?
for example I have someone send email which have today article with the image as an attachment and it have to send to particular email address (eg: abc#something.org) to be able to process data to sql table, other address will not work for updating.
Once it receive, it automatically proceed and update sql from the article it receive.
How is it work?
is there any open source that may help this process
Not by sql, you have to involve some sort of programming language which have a subset of methods to communicate with the database and that can receive and send email.
Take a look at Sendgrid (at http://sendgrid.com): they have a parse API (see http://wiki.sendgrid.com/doku.php?id=parse_api for details) that basically lets you convert an email into an HTTP POST. So if you already have a web page that can update the MySQL database you can just modify it to comply with their spec, set up a sub domain that forwards to Sendgrid and then setup a Sendgrid endpoint that takes any email to that sub domain and posts it to your web page.
It depends on your application. If you're using a framework like Wordpress, there are plenty of plugins available to integrate (e.g. Postie). If you have your own custom application, you may find an open source script to download the new messages, but you'll have to implement your own code to update your database.

send database info to email

I was wondering if sanyone could help me with the following:
I have some info inserted into mysql database on a couple of pages. After this is done I retrieve these info (in a new page) from the database and want to send them via email to various emails including one from the info from database.
I have built the email() function and "SELECT" all the info from the database (have them into some HIDDEN fields).
I am not sure how to go about getting these info sent via email.
I have tried, but all I get is an empty email with no info from database.
Hope I explained my problem and someone can give me clue about this.
Many thanks
Francesco
MySQL does not include a feature for sending email. So you'll need to write additional software to handle the job for you.
One issue to decide, how will the email be requested? -- How will the process be initiated?
You could have your web page (written in PHP or any other language), which shows the information on the screen also send the email. See sending email from php.
A better performing idea is to first queue up your requests for sending emails. That way you won't slow down your web server. Then have a background job process each of the requests, reading the database and sending off the emails. Google for "php background processing" for help or ask more questions on StackOverflow.
Also, remember to check that your email is not being treated as spam.
Re: using the data from the database for sending the email--that's easy, just read the database, then use the information for creating the email's to, cc, subject and other fields.