Php Auto Responder

Discussion in 'PHP' started by baligena, Jul 27, 2011.

  1. #1
    Does anyone know a good tutorial for a php auto responder.

    auto responder: a system that automatically sends email
     
    baligena, Jul 27, 2011 IP
  2. exodus

    exodus Well-Known Member

    Messages:
    1,900
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    165
    #2
    It would not be resource effective to make it in php. You would need to constantly log into a mail server to check for new mail. You could program a mail server in php that would in turn auto respond once a connection from a remote mail server was made and a mail was passed to it. You would need to figure out how to open up a different socket for php to listen to and then interrupt the mail server commands and return the right ones.

    Here is the RFC for the smtp protocol that you would have to code in php.
    http://www.faqs.org/rfcs/rfc821.html

    Honestly your time would be better spent looking at already created mail servers or making one in a different lanague. Most of the articles I found are with a 3rd party mail server interacting with php and not php being the mail server itself.

    Or on the other hand you might create something very cool and lots of people would say look at that.. just look at what they did with php. :) Good stuff.
     
    exodus, Aug 8, 2011 IP
  3. marleypeters

    marleypeters Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It's easy with php. Just use cron to send out emails at an interval you determine. That's how the third party auto responders work.
     
    marleypeters, Aug 8, 2011 IP
  4. exodus

    exodus Well-Known Member

    Messages:
    1,900
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    165
    #4
    I am sorry I read the auto responder and this is what I thought.

    They need to do an auto mailer program then. Yeah that is totally doable with php. As long as you give it the email to auto email.
     
    exodus, Aug 8, 2011 IP
  5. achraf52

    achraf52 Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You need to write a code that check your e-mail inbox and if it founds a new e-mail it get the sender address and mail it a automatic mail and you can also specify a specific subjects gets specific reply or specific message gets specific reply or two and have a cron job to open that file every 5 minutes or so .
     
    achraf52, Aug 9, 2011 IP
  6. elixiusx

    elixiusx Peon

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #6
    You should create a PHP Script (autoresponder.php) for example.

    1. Find a PHP imap reader class in google
    2. You should use the PHP IMAP Functions to read the "From" and the Emails ID, i know the imap_headers() function return the Emails ID, i don't know if also return the "From"
    3. When you get the "From" email address send the automated email.
    4. Save the responded emails ID into a file or database.
    5. Configure your Cron Jobs to visit your autoresponder.php file (curl http://yoursite.com/autoresponder.php) every 5 minutes for example. Autoresponder.php will read your email, if autoresponder.php found a new Email ID ( thats mean not in database or text file ). Send the automated email.

    Excuse my english, i hope you understand me....
     
    elixiusx, Aug 10, 2011 IP
  7. HungryMinds

    HungryMinds Active Member

    Messages:
    216
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    63
    #7
    Yes CRON JOB Is Best For This Method.
    Create You Script & Submit The Path Of The SCRIPT In CRON JOB SCRIPT FILE PATH & Set DATE & TIME
    CRON JOB Will Perform It's JOB On You Submitted Date & Time.
    You Can Find CRON JOB Icon In Your HOSTING CONTROL PANEL.
     
    HungryMinds, Aug 10, 2011 IP