Solved

parse email with php (LDA dovcot, procmail)

Posted on 2013-01-12
3
316 Views
Last Modified: 2013-01-13
Using the mailparse to extract the data or use the read in nd process the input buffer one line at a time.  A better and simpler approach depending on your mail server and whether it is passing the incoming mail through an LDA dovcot, procmail. The from and the body can be extracted and presented to your php with the from and subject as arguments to your script and the body of the message as input on stdin.



I am looking to parse email with php

how would I do this
0
Comment
Question by:rgb192
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 300 total points
ID: 38772021
You might want to start with an understanding of the email RFC documents.  The references and external links with this article are mandatory reading.
http://en.wikipedia.org/wiki/Email_address

After that, it's just plain and simple PHP string manipulation.  You can use explode(), strpos(), substr() and related PHP string functions to manipulate the strings, extract data, etc.
0
 
LVL 78

Assisted Solution

by:arnold
arnold earned 200 total points
ID: 38772198
Limiting your inquiry to PHP eliminates many experts with mail processing abilities and insights. Add the mail server in use as a category.
0
 

Author Closing Comment

by:rgb192
ID: 38772551
thank you

the first answer was about email
and the second answer was about asking questions on experts-exchange


I have a related question based on the second answer

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_27993920.html
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question