Solved

pear errors from mail parser

Posted on 2013-01-15
11
471 Views
Last Modified: 2013-02-04
this question is related to the code sample I received in
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_27993920.html

chdir(dirname(__FILE__));
require_once 'class.email.php';

// Parse incoming email from STDIN
$email = email::parseSTDIN();

//Who sent the message
$sender=($email->getSenderEmail() );
//TheMessage itself
$message = trim($email->getTextContent());
//Who the Message was sent to
$to =  ($email->getRecipientEmail());
//The Subject of the eMail
$subject = ($email->getSubject());

Open in new window



mail.zip


Warning: require_once(PEAR.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\mail\Mail\mimeDecode.php on line 65


require_once() [function.require]: Failed opening required 'PEAR.php' (include_path='.;C:\Program Files (x86)\NuSphere\PhpED\php5\..\include_lib') in C:\wamp\www\mail\Mail\mimeDecode.php on line 65
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
  • 6
  • 4
11 Comments
 
LVL 6

Expert Comment

by:Kailash Aghera
ID: 38781355
You will have to put pear package file in your PHP "include_path" directory. You are receiving this error because PEAR.php is not available in your directory as well as in your PHP include path.
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 38781365
I think it must be path problem. You need to configure the right path there. check out, http://pear.php.net/manual/en/installation.getting.php
0
 

Author Comment

by:rgb192
ID: 38785432
do I change the location in one of the included files (see original question attachment)
0
Independent Software Vendors: 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!

 
LVL 6

Accepted Solution

by:
Kailash Aghera earned 500 total points
ID: 38785794
Hi,

You will need to follow the below steps:

[1] Install pear package in your system if it is not installed
[2] Edit your php.ini file and add your pear package installation path in include_path like as follow:

include_path='.;C:\Program Files (x86)\NuSphere\PhpED\php5\..\include_lib;c:\pear'

Replace c:\pear with the location of your pear package.

[3] To find your php.ini upload phpinfo() page and check the location for "Loaded Configuration" file path. You will need to edit this php.ini.

[4] After making the changes, restart your web server.

Kailash
0
 

Author Comment

by:rgb192
ID: 38785819
do i have to change any of the attached mail files to include address of pear
0
 
LVL 6

Expert Comment

by:Kailash Aghera
ID: 38787615
Once you set pear package path in your php configuration, you do not need to modify any files or source. It should include pear module automatically when it is required..

Kailash
0
 

Author Comment

by:rgb192
ID: 38799854
I can not get pear to run on localhost wamp

but I uploaded file and folder to hostgator (which has pear)

 file ran with no errors and echo line number at the end (line 16)

<?php
chdir(dirname(__FILE__));
require_once 'class.email.php';

// Parse incoming email from STDIN
$email = email::parseSTDIN();

//Who sent the message
$sender=($email->getSenderEmail() );
//TheMessage itself
$message = trim($email->getTextContent());
//Who the Message was sent to
$to =  ($email->getRecipientEmail());
//The Subject of the eMail
$subject = ($email->getSubject());
echo __LINE__;

Open in new window


do I need to have this file be the pipe which is setup in cpannel.

if so, do I need a she bang at the top of script
0
 
LVL 6

Expert Comment

by:Kailash Aghera
ID: 38808523
do you want to execute this script via cron or do you want to use this script for other purpose?
0
 

Author Comment

by:rgb192
ID: 38813341
when email is received using email piping

or

reading input .eml file (easier for testing)
How should I change stdin to input .eml file
0
 

Author Comment

by:rgb192
ID: 38843326
could I replace line 5

// Parse incoming email from STDIN
$email = email::parseSTDIN();


with a copy paste email .eml file

$email='this is the eml file'
0
 

Author Closing Comment

by:rgb192
ID: 38852689
you told me to run on a server with pear which is a step in the correct direction

thanks
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

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…
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.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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.

752 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