contact collection - php, mysql, mail server - php

I am building a project assuming that there is a method for intercepting incoming and outgoing mail from a mailserver. If it is not possible please let me know, I am new working with mail servers, so any material that you could provide would be greatly appreciated.
I am building a project to manage contacts and the organization's interaction with them throughout a broad range of services. I would like the creation of the contacts be as automatic as possible. In this sense, what I had thought would be interesting was to create a page that would intercept all incoming and outgoing message from the org.'s mailserver. The intercepted data would be stored on a MySQL database.
Is this possible in PHP? Would this be the correct way of going about it?
What I'm looking for is a place to start looking and learning. Reading materials, tutorials, case-studies, etc. Whatever you can send over to help me get closer to my goal. Also, if the method I've described above is flawed, or you can recommend a better method, I'd be willing to hear your thoughts on that as well.

If so have a look at PHP's IMAP functions as they provide everything you need to be able to do this quite easily.
Have a look at http://www.php.net/manual/en/ref.imap.php and ask any specific questions about the functions used you may have.

Related

import email data to the DB

I built support system (web) where my helpdesk can open new tickets/issues.
I want my clients to be able to send email with the issue text and file attache, to specific email address, and new ticket will be opened in my system.
For that I need to know how to scan the folder and how to add the email data to my DB.
what do I need to look for, in the internet, for that? what is the subject?
(I'm using PHP)
As the other's have commented, it's likely a larger task than you're ready to handle. But it doesn't hurt to try.
If I was tasked with the job, I'd take advantage of Gmail (for it's spam reducing features and large storage) to accept incoming email. From there, you simply need to setup a script that connects to your email account and processes the email for storage in your database.
Normally I recommend a solid library for making the job easier and cleaner, but I have a suspicion that you may not be familiar with OOP. If you at least know how to utilize classes, then check out Github:
https://github.com/search?l=PHP&q=imap&ref=searchresults&type=Repositories
Otherwise, if you're new and don't mind writing something "messy" then the following should at least point you in a good direction:
Connecting & retrieving emails for IMAP:
http://www.php.net/imap
http://www.php.net/manual/en/function.imap-open.php
Fetching/processing attachments:
(note that attachments are part of the email body)
http://www.php.net/manual/en/function.imap-fetchstructure.php
Storing attachments (in the filesystem):
http://www.php.net/manual/en/function.mkdir.php
http://www.php.net/manual/en/function.file-put-contents.php
There's plenty of Googling left for you to do. So go forth and make a lot of mistakes. Read the manual. Kick yourself for not having read it sooner, then go make more mistakes. Isn't that how most of us learn?
The first thing that comes to mind is to pop the most recent emails if you have pop3 set up or use imap functions. I did something similar to this using c# using openpop.net. So that could be a starting point.
You can use this method, using the cURL to fetch the emails from Gmail server through feed atom. XML response will return and we can convert it to HTML.
http://www.code4share.net/items/get-unread-email-in-gmail-by-php/XRGXVVh.html

XMPP for PHP (how to do it)

First I'll outline my problem.
What I want to do is create a site. When a client connects, every second or so a number will be broadcast by him.
This is done by everybody on the site.
So every second every client receives every other clients number.
My Solution (that isn't currently making sense)
I thought of using XMPP and an OpenFire server to do this, but I can't seem to make it work with PHP.
Finally the question
Is there a better way to solve my problem than the one I outlined? Another potocol or something?
Is there something that'll play nicely with OpenFire
I already looked at these
http://code.google.com/p/xmpphp/
https://github.com/tong/hxmpp/
and Happy new Year,
XMPP, is the most common way with dealing with notifying problems, but yet you can use a less heavy approach (Technique) to deal with your problem which is Pushlets, and for sure the previous link is not the only one. Pushlets area servlet-based mechanism where data is pushed directly from server-side to (Dynamic) HTML pages within a client-browser. This allows a web page to be periodically updated by the server.
and sure it's much lighter than XMPP.
you can also use it with Java server side like in Here, which will give you some new ideas.
anyways, if you have a web application which has a lot of users you have to think twice then. and make sure that XMPP gives you a lot of controlling features over many requests. When pushlet is good enough to do your broadcasting.
Hope that will help you.
Read this http://belski.net/archives/37-Phurple-for-PHP-5.3-and-up.html
You can make it work with PHP+XMPP using the phurple extension. It works upon libpurple which is the base for Pidgin. That will make you able to work with many other protocols as well, XMPP will already enable Facebook, Google and any other XMPP based.

most efficient client to client chat system

i am trying to build a one on one chat web application in php.
currently i am using a mysql database to hold messages as well but i recognize that this is very inefficient. i would like to have ONLY a user table with the ip address and some sort of script to allow each single client to directly connect to the user that clients wants to talk to. i am looking for someone who could point me into the right direction.
basically i do not want the server to take care of the messaging system but still letting the users sending private messages to each other and be able to switch between the various conversation tabs. i read a bit about node.js, but i am not quite sure it's the right thing?
if maybe you can show me some pseudocode or just simply point me into the right direction would be good.
Thank you in advance.
What you're asking for is impossible. There is no way to cause a browser to accept incoming connections using Javascript. (Nor would that even work reliably if there was, as most users nowadays are behind some variety of NAT or firewall.)
What you're asking is impossible, there always has to be a server in the middle. All chat systems are using a server.
I know this isn't really answering your question, but why not use MSN Messenger or yahoo chat.

Is it necessary to use PHP in order to create an automated form for a web page?

Is there an easy way to set up an automated form on a web page that sends info to a specific email address after being filled out? I don't know much about php, but someone mentioned it as a possibility. I would like to create a form that gets filled out and sent to a server email address automatically. Preferably without having to learn anything besides html/css.
Thank you.
No you do not need PHP but you need some server code.
The most common one used to be FormMail for CGI.
There is now a FormMail implementation for PHP as well.
Ask your web host what they support. They usually have examples
as well.
Yes, there are a lot of tutorials out there.
Heck, they even have generators that will create the script for you.
If you want to code it yourself, php's mail() function is what you will probably use.
Good luck.

PHP - How to add stuff from a database into a newsletter?

Hey guys. I need help for a project for school. Essentially, I need to write a program that sends newsletters. I can send the newsletters and stuff, but the main issue I'm having is that the newsletter needs to contain things that are contained in a database. How exactly do I draw those things and put them into a newsletter? The bulk of it needs to be in PHP, but Java and stuff can be used, if needed. Also, I cant install anything on my portion of the schools server, so I cant use any CMS's and stuff.
Unless you are writing this for fun and learning, don't do it.
You will get your IP blacklisted and have lots of problems. there are regulations (CAN SPAM etc) and best practices (SPF, domain keys etc) you need to follow if you want this to be successful. Otherwise you will not get any of your mail delivered, and possibly a call form your ISP.
How do you handle unsubscribes? How are you going to handle bounces? Mail loops? Blacklisting of problem addresses? This is not a simple topic.
You would be better off purchasing a email management system;.
Lyris makes one that you can install. There are other free/open source projects as well (majordomo, mailman etc).
Heed these words intrepid e-mailer!
Hey, do you have basic problems with querying your content from your database?

Categories