homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

PHP activated by a mail?
Is it possible?

 5:08 pm on Sep 18, 2003 (gmt 0)

Is it possible to send a mail to "bar@foo.com" with some parameters (could be like
you=not me
or just
not me)
and make a PHP script(or something else) receive the message, and parse it?

Thanks in advance!



 5:46 pm on Sep 18, 2003 (gmt 0)

If you want to send mail use the mail() function. You can find more information regarding how to use PHP mail in the PHP Manual [us4.php.net].

As far as receiving the mail and parsing...well, that's out of your control. The recipient's server determines how to handle the mail, not you.


 5:54 pm on Sep 18, 2003 (gmt 0)

Many mail processing progs have options to process mail with external scripts - does your server have procmail?:




 5:59 pm on Sep 18, 2003 (gmt 0)


You could, if you have access to the server that you host on, edit the aliases file (on unix) and point a email address to a perl file, use the perl file to read any values and arguments, and then use that to pass to PHP.

I thin this is a very basic outline of how it can be done, but I think that it is a possibility.



 7:15 pm on Sep 18, 2003 (gmt 0)

procmail is definatly the way to go if you have it. It's a very powerfull tool. I do just that looking for bounce messages. A mail comes in an a PHP script fires to process it. Then decide weither to pass it to me or delete it.



 2:44 am on Sep 19, 2003 (gmt 0)

Sure ... anything a human on a browser can do can be replicated with some kind of scripting. Addressing the "or something else" rather than the PHP part of your question, the perl module Mail::POP3Client makes it a snap to write a perl script to check a pop3 account and automatically manipulate email to your hearts content. Set the script up to run automatically every few minutes/hours and it's makes for a nice way to handle various concerns of incoming email.


 7:06 am on Sep 19, 2003 (gmt 0)

I would think it's do able. Here's an interesting article [devshed.com] that would get you started on retrieving the email with PHP. To do it automatically you'll need to set up a cron job.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved