SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Evangelist compwizard's Avatar
    Join Date
    May 2002
    Location
    United States
    Posts
    457
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Respond to emails in php?

    Hi, I was wondering... is there a way to respond to incoming emails in php. For example, I want to create an email auto responder in php. Is there a way to do that?
    Compwizard
    "There are 10 kinds of people in this world -- those who know binary, and those who don't."

  2. #2
    SitePoint Guru coiL's Avatar
    Join Date
    Sep 2001
    Location
    QLD, Australia
    Posts
    666
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you mean an auto-responder for when people send you email via a form, like a contact or feed back form?
    coiL
    "cradled in the learning curve"

  3. #3
    SitePoint Evangelist compwizard's Avatar
    Join Date
    May 2002
    Location
    United States
    Posts
    457
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, I mean if people send an email to a specifc address from their own email account
    Compwizard
    "There are 10 kinds of people in this world -- those who know binary, and those who don't."

  4. #4
    Can we go to a 48 hour day?
    Join Date
    May 2002
    Location
    MI
    Posts
    906
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you set up a script on the server to call the php commands. The server would have to detect the email and run the php as the php cannot tell when a new email arrived.
    mitechie.com
    "Techies just think a little differently
    ...at least that is what they keep telling me."

  5. #5
    SitePoint Evangelist compwizard's Avatar
    Join Date
    May 2002
    Location
    United States
    Posts
    457
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That is exactly what I need to know.. how do write the script for the server?
    Compwizard
    "There are 10 kinds of people in this world -- those who know binary, and those who don't."

  6. #6
    Can we go to a 48 hour day?
    Join Date
    May 2002
    Location
    MI
    Posts
    906
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, you can look at filters that can be triggered like procmail. I haven't done it...just know it is possible. You might start with procmail and see if has instructions for you.
    mitechie.com
    "Techies just think a little differently
    ...at least that is what they keep telling me."

  7. #7
    Can we go to a 48 hour day?
    Join Date
    May 2002
    Location
    MI
    Posts
    906
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just saw this in the advanced forum. It is run by cron, but the links there might help you out some more.

    http://www.sitepointforums.com/showt...hreadid=110295
    mitechie.com
    "Techies just think a little differently
    ...at least that is what they keep telling me."

  8. #8
    SitePoint Zealot
    Join Date
    Jun 2000
    Location
    Yeppoon, Australia
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are a couple of ways to do this depending on the system you're using.

    1) You can use a script (scheduled with cron or whatever) to read a POP/IMAP/whatever mailbox and process the messages as necessary. For a tutorial on doing the POP3 with PHP thing check out www.devshed.com

    2) Gijs Van Tulder, who wrote the rather nice article here at SP about hierarchical data storage and processing, has an article on doing exactly what you're asking at his site: http://gvtulder.f2o.org/articles/incoming-mail/

    The method discussed is probably the ideal but may not be possible depending on the host, etc.

    Have fun.
    Knowledge is knowing that a tomatoe is a fruit; wisdom is not putting it in a fruit salad.


Bookmarks

Posting Permissions

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