Solved

parse email with php (LDA dovcot, procmail)

Posted on 2013-01-12
3
308 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
3 Comments
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 300 total points
Comment Utility
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 76

Assisted Solution

by:arnold
arnold earned 200 total points
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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 …

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now