Receive Email Using PHP

Can you receive emails through PHP?

You can pipe incoming mails into a PHP script so you can process it directly. Evolt has an article on how to setup something like that. This can be useful if you want to activate scripts programmatically by sending Emails to it (like responses to a newsletter mail that unsubscribes the user).

If you just want to read mails using PHP, PHP has native functions to talk to IMAP, NNTP and POP mailboxes.

How do I receive email and process it in a web application

I recently worked on a project that required parsing of email from gmail and updating database with certain values based on the contents of the email. I used the ezcMail (now) Zeta Components library to connect to the mail server and parse the emails.

The strategy I adopted was to filter all interesting incoming mail with a label "unprocessed". Run the PHP script via a crontab every 15 minutes. The script would connect to the mail server and open the IMAP unprocessed folder and parse each email. After inserting the interesting values into the database, the script moves the files to another IMAP folder "Proccessed".

I also found IMAP to be better than POP for this sort of processing.

How can I process incoming emails using PHP

For those with the same issue:
http://davidwalsh.name/gmail-php-imap

For French-speaking people (the code is understandable by non-French speakers):
http://nicolas-vieux.developpez.com/tutoriels/php/fonctions-imap/

Receive Emails into my Admin panel with php or other

yes, you can access you inbox from php. Please have a look at PHP's IMAP library: http://php.net/manual/en/function.imap-open.php

Unlike the name suggests, this library can work with imap, pop3 and nntp so you should not have issues with accessing your inbox.

Receive Email using PHP

Try php-imap library. It's very popular and stable.

Receiving and Processing Incoming Emails with PHP

1) You can setup 'catch-all' email for incoming messages so all email will land there. For accesing emails you can use POP3 or IMAP which are supported by PHP: some example: link. SMTP is for sending emails.

To read emails you would have to setup CRON job that periodically checks your master account for new messages - just like any other email client.

2) If you must setup own mail server use Linux with Postfix/Dovecot great tutorial for Debian but you can use PHP to just access mailbox and process new emails.

To send emails you can use some library (I've recently used Zend Mail component and it works great ).



Related Topics



Leave a reply



Submit