473,396 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How e-mail receive works with php ?

How to set up my PC (or what tools do I need) so that when any email
comes to the server, a php script is automatically run to parse the
email ?

I've never done this before. Later I would like to transfer my website
to a Linux box, but I'm using a PC currently to develop the site.

Details are welcome. In fact I have no concepts about which program or
"server" is supposed to receive email, then how would that program
"pass" the email as a parameter to a php script ? Is a pop server
involved in this process ? If yes, the what is the most popular one
(which is available for both pc and linux) ? And so on..

Thank you.
Mike

Jul 17 '05 #1
5 7448
On 25 Mar 2005 10:31:09 -0800, "siliconmike" <si*********@yahoo.com> wrote:
How to set up my PC (or what tools do I need) so that when any email
comes to the server, a php script is automatically run to parse the
email ?

I've never done this before. Later I would like to transfer my website
to a Linux box, but I'm using a PC currently to develop the site.

Details are welcome. In fact I have no concepts about which program or
"server" is supposed to receive email, then how would that program
"pass" the email as a parameter to a php script ? Is a pop server
involved in this process ? If yes, the what is the most popular one
(which is available for both pc and linux) ? And so on..


Look up "procmail".

Normally there will be an SMTP mail server running on wherever your email
account is. This will receive emails, and write them to your mailbox. procmail
can be used to run programs in response to emails arriving.

POP3 comes into the picture when you want to get at your mailbox from a remote
machine.

If you're developing on your PC, then it's unlikely that PC is going to be
where emails arrive, i.e. it won't be running the receiving end of an SMTP
server. You could use "fetchmail" to regularly fetch email locally, "procmail"
to run them through PHP, and run a local POP3 server if you then also want to
read the same emails with a POP client.

Also look up Cygwin - this is a particularly useful bit of software, as it
gives you a Unix-like environment on Windows. You'll then be able to work with
the same tools that'd be available later when you move it to Linux.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
I checked. Procmail has no port for windows:

http://laku19.adsl.netsonic.fi/era/p...ni-faq.html#nt

Maybe I can do something like this:
- run an smtp server on my win xp box
- send email to someone@localhost
- receive email on localhost
- auto-run a php script upon receiving the email

but how ? what tools ?

Thanks
Mike

Jul 17 '05 #3
On 26 Mar 2005 03:56:50 -0800, "siliconmike" <si*********@yahoo.com> wrote:

[ Please quote some context when replying ]
I checked. Procmail has no port for windows:

http://laku19.adsl.netsonic.fi/era/p...ni-faq.html#nt
That's why I recommended Cygwin; you get a complete Unix toolset on Windows,
including the gcc compiler, and it provides enough compatibility that many Unix
applications will compile from source without modification if Cygwin doesn't
include a pre-built version.
Maybe I can do something like this:
- run an smtp server on my win xp box
- send email to someone@localhost
- receive email on localhost
- auto-run a php script upon receiving the email
Yes, that's pretty much what I said, except I would probably avoid running the
SMTP server on the XP box. Use an account elsewhere, and use "fetchmail" to
retrieve the email, "procmail" to run it through PHP and optionally bounce it
on to another account that you can read with POP3, unless the emails are
entirely for PHP and you don't need to read them yourself, in which case skip
the bouncing step.
but how ? what tools ?


Cygwin.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #4
siliconmike wrote:
How to set up my PC (or what tools do I need) so that when any email
comes to the server, a php script is automatically run to parse the
email ?

<snip>

Look at this thread
<http://groups.google.com/groups?threadm=cnn3c.529026$na.1267192@attbi_s04>

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jul 17 '05 #5
<snip>

Look at this thread

In your thread is shown method to pipe email to a php script.

What part of the email is piped ? I presume a full header + email body
would be piped .. right?

I need to extract the From: and To: fields from the email header. Where
can I find official email header format ?

Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Wald | last post by:
Hello group, I've got a script here that sends emails with an attachment to an email address that is retrieved from an html form. The email sending code is include below. The problem: when...
0
by: Paul | last post by:
Hi, Need some advice and hope I'm in the correct group. I need to write an application will receive mail messages on SMTP (port 25) and, depending on some of the headers, alter the message...
1
by: Jay McGrath | last post by:
Help - trying to send a simple text email with with as little user intervention. I am trying to create a button in my Access application that will automatically send a simple text email. It...
1
by: Homa | last post by:
Hi, I'm writing a webpage that will send sms to cell phone using smtp (System.Web.Mail.SmtpMail.SmtpServer) When I send to tmobile (tmomail.net) or cingular (mycingular.net), cell phone...
15
by: tshad | last post by:
I am trying to put an persons email address in a response I am sending another person. I can get it to work by doing the following: message.Body = resumeTop & vbCrLf & vbCrLf & "For Applicant:...
5
by: venky | last post by:
Hello all, I wrote a small program which sends email to different address. I am using smtp object and i set smtp server as my verizon online. I use to send the email, everything works fine...
14
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
36
by: Liam.M | last post by:
hey guys, I have one last problem to fix, and then my database is essentially done...I would therefore very much appreciate any assistance anyone would be able to provide me with. Currently I...
3
by: =?Utf-8?B?UGhpbGlw?= | last post by:
I switched from System.Web.Mail to System.Net.Mail, however I am now reconsidering that move because if I send an email to an email address in the form john.doe@yahoo.com, I receive an error...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.