![]() |
| HTML | PHP Scripts | Webmaster Tools | Webmaster Forums | Web Hosting | Domain Names | Webmaster Books |
|
|
#1 |
|
New Member
Join Date: Nov 2009
Webmaster Discussions: 1
Rep Power: 5 ![]() |
Hi, i am working on a project. i need to read every incoming mail sent to an email address. this mail will be redirected to a php code for processing. do anyone has any idea how to i can write this code in cgi.
thanks |
|
|
|
|
|
#2 |
|
Join Date: Aug 2008
Location: Texas
Webmaster Discussions: 501
Rep Power: 21 ![]() ![]() ![]() ![]() |
Re: read incoming mail and redirect to php script
You can do this using Exim and procmail. Check with your server administrator to find out how to use an Exim script on your server.
For example, I have the following .procmailrc file on one of the sites I have developed that processes a specific format of email and redirects those emails to a PHP script: Code:
VERBOSE=off
#LOGABSTRACT=yes
SENDMAIL=/usr/sbin/sendmail
SHELL=/bin/sh
MAILDIR=$HOME/theFolder
LOGFILE=/home/*********/procmail.log
DEFAULT=$HOME/theFolder
#Get the subject discarding any leading and trailing blanks
#Note: On some systems -xSubject: has to be -x"Subject: "
SUBJ_=`formail -xSubject: \
| expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`
:0:
* ^Subject:.*.Repair Order
{
:0 fwh
| formail -I"Subject: ${SUBJ_}"
:0c:
$DEFAULT
:0:
|/usr/bin/php -f /home/*******/public_html/scrape.php $LASTFOLDER
}
Code:
|/usr/bin/procmail -v
__________________
Be sure to click the reputation icon to give rep to the person who helped you. For web design/development services, check Silentium Designs. |
|
|
|
|
|
#3 |
|
New User
Join Date: Mar 2010
Webmaster Discussions: 1
Rep Power: 3 ![]() |
Re: read incoming mail and redirect to php script
Hi, I am new to this and I need to learn how to redirect the incoming mail to a php script.
I am using LSMTP mail server, on windows server 2003. I need to know how to configure it so that, a mail coming to an email-id to a php script. Please help me out. Last edited by deepak229; 03-09-2010 at 11:12 PM. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Rate This Thread | |
|
|
Similar Webmaster Discussions
|
||||
| Thread | Webmaster Discussion Starter | Forum | Replies | Last Post |
| Problem with mail-script | adamsen | PHP Forum | 0 | 09-28-2009 12:54 PM |
| Php Mail script being Spammed | richybear | PHP Forum | 7 | 04-27-2007 06:19 AM |
| js redirect | f&m | Javascript Forum | 2 | 02-09-2005 03:30 AM |
| php mail script help | Derek | PHP Forum | 14 | 12-01-2003 02:23 PM |
| redirect advice please | Webeauty | Search Engine Optimization - SEO - Forum | 4 | 09-18-2003 12:15 PM |