How do I handle incoming mail with PHP?

Author Topic: How do I handle incoming mail with PHP?  (Read 1514 times)

Offline chinmay.sahooTopic starter

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 158
  • Karma: 0
    • We Helpline
How do I handle incoming mail with PHP?
« on: 07-16-2016, 07:28:32 »
You’ve already seen that sending mail with PHP is no problem. But what about dealing with incoming mail using PHP? If your site is hosted on a Linux system, you’ll be happy to hear that with a little tuning, it’s easy to have PHP to examine incoming email.

In this solution, I’ll assume that you have your site hosted on a Linux-based system, that you have command prompt access to the server and are able to run PHP from the command prompt, and that you’re using sendmail to handle email on the server. Phew! It’s a long list of requirements, I know, but this fairly common configuration greatly simplifies matters.

First things first: you need to place a file called .forward in your home directory. Use a text editor to write the following to the file (all on one line):

Offline TomClarke

  • Trade Count: (0)
  • Hero Member
  • *****
  • Thank You 55
  • Posts: 837
  • Karma: 0
  • Gender: Male
    • Custom Writing Service & Content Marketplace
Re: How do I handle incoming mail with PHP?
« Reply #1 on: 07-18-2016, 04:03:20 »

If your host support the PHP IMAP functions, you can use it to loop through emails in an email account and insert them in the database.
Your ideas, our writings -


Related Topics

  Subject / Started by Replies Last post
4 Replies
Last post 09-15-2011, 05:00:01
by sufalamtech
6 Replies
Last post 12-22-2011, 04:26:28
by smith
5 Replies
Last post 08-14-2015, 04:10:30
by ajaymehta588
1 Replies
Last post 05-11-2016, 01:20:26
by TomClarke
0 Replies
Last post 07-05-2016, 04:38:22
by chinmay.sahoo