Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

parse email with php (LDA dovcot, procmail)

Posted on 2013-01-12
3
Medium Priority
?
321 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 111

Accepted Solution

by:
Ray Paseur earned 1200 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 79

Assisted Solution

by:arnold
arnold earned 800 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

Technology Partners: 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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
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.

715 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