Welcome Guest, Not a member yet? Register   Sign In
Handle incoming emails

Is there a way for CI to handle incoming emails? For example Im creating my website and part of my client area is here they can email regarding their project... anyone know if I can pipe this to CI to insert into the database?


[eluser]Pascal Kriete[/eluser]
If they're sending the e-mail from any old account, then no. You would need your own MTA for a start, this would be quite an undertaking.

You could make a standard contact form where they leave their e-mail address and a message.

they would be sending from the email on their account and the subject would also contain the project ID... I dont know about incoming emails but I thought it would read the email address, grab the project ID and post the contents into the database for the particular project but would cross match the project with the email to ensure noone can just email regarding any project.

Hope this makes sense.

[eluser]Pascal Kriete[/eluser]
Yup, that makes perfect sense. Sadly, unlike sending mail, this isn't as easy.

You'll need a local mta such as qmail.

I've never done anything like this, but it must save the incoming mail somewhere. If it's saved in any kind of comprehensible format you could have a update_mail() type of function in your admin area. That would then check the directory with the new messages and add them to your database (or make a cron job do it).

Yeah, you could (like inparo said) have a something (cron) check the POP account every once in a while and pipe all of the mail to a database.

Could you setup an email forwarder to pipe the email to a PHP script, then use
fopen("php://stdin", "r");
to read the input?

You may be able to get it to work with CI or just write a plain old php script?

[eluser]Pascal Kriete[/eluser]
Check out this page. It's a little dated, but the basic concepts still apply.

[eluser]CI jforth[/eluser]
I used this for the same idea. check it out

but I plan on using zend_mail for another project.

Here are 3 services that can help you do it:

1. Email2PHP

2. Email2HTTP

3. Mailhook ( still around? )

Theme © iAndrew 2016 - Forum software by © MyBB