Re: PHP and connection to mail account

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jochem Maas wrote:
Angelo Zanetti wrote:
Do u know if its possible with PHP to receive a mail or connect to a
mail box and do something with an incomming email ? I see there is that
imap_open() but also there are sockets.

indeed - basically use whatever you want! - I would suggest have a search online,
there are quite a lot of mailbox related classes/libs/etc as well as fully featured
php webmail packages that you might be able to scrounge some useful code out of.

an alternative could be to configure your mail server to pipe the incoming
email directly to your script (i.e. don't deliver it to a mailbox at all) -
this has the advantage that your script doesn't have to run as a daemon (or via cron)
in order to poll the given mailbox - it simply recieves the email on stdin
whenever an email arrives.

Just to add something to consider... which way you do it can depend on what your script will be doing and how many emails you expect to receive. If the script is intensive and/or you are expecting a lot of emails you're better off cron'ing a script to deal with them otherwise your server could end up bogged down by those processes. I can't speak for other MTAs but I do know that with Postfix you can apply a limit to the number of simultaneous processes that are started if you implement it in the transport map.

-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux