Solved

parse email with php (LDA dovcot, procmail)

Posted on 2013-01-12
3
315 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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.

756 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