Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2011
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Push email support in php 5.3

    Hi All,

    Is push email is supported in php 5.3 ? If anyone knows please reply and also give an example.

    Thanks in advance.

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,344
    Thanks
    13
    Thanked 349 Times in 345 Posts
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #3
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,345
    Thanks
    60
    Thanked 527 Times in 514 Posts
    Blog Entries
    4
    Any server that pushes something to its client needs a constant connection. Then its down to the protocol being used. If its just regular pop then the client will poll on a regular basis.

    AFAIK, there isn't a 'push email' type of protocol.

    How php 5.3 will support this is a vague question. If you're running a php pop daemon, then it would be down to your own code to support this. PHP doesn't generally act as a server in its own right (although it has the ability via your own code) so unless PHP is planning to offer this as a class or library I don't really think it's going to be a new feature.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    As mentioned, PHP *can* and always has had the ability to do this (for sure since 4, can't remember what <= 3 provided for socketing, but that's a pretty trivial fundamental of a web based language I'd say). That would be writing a simple socket app. The real question would be why bother? There are many many other languages far more suited to this job than PHP is (even perl comes to mind here).

    So short answer, sure PHP has always been able to do this, but that doesn't really make it a great idea. You wouldn't run this in a web environment either, rather you would simply set up listeners on the pop and imap sockets. Mail comes in, PHP would do something with it, and away you go.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •