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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 19

Thread: Auto responders

  1. #1
    Saz
    Saz is offline
    Regular Coder
    Join Date
    Jun 2005
    Posts
    277
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Question Auto responders

    Looking for some type of auto responder, so that when the sender sends an email or form enquiry, they then get back an email, which includes what they originally sent, but with a pre-worded bit at the beginning of the email.

    Any help appreciated.

    Saz.

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    All the (paid) hosts I've had come with these.
    Did you check if your host offers autoresponders?

    If you (or your company) own the server, you have to set this up in the mail server (Exchange, etc).

    As an alternative to an autoresponder, you could have the process that catches a form submit e-mail them back, but this would not catch direct mail from a mail client (mailto, etc).

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    Senior Coder
    Join Date
    Jul 2005
    Location
    UK
    Posts
    1,051
    Thanks
    6
    Thanked 13 Times in 13 Posts
    I've been considering doing this as well. My host does offer it as a feature but I think it's far more interesting to do it myself, and I would do as suggested above, after the mailhandling script has executed the mail to you, have it execute another mail to the form submitter before redirecting to your thank you page.

  • #4
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well to do it from a contact form, you could process it in PHP -

    I'm not too good at PHP atm, but say you were retrieving a few details, email, first name and last name...

    You'd get the values like so -

    $email = $_POST['email'];
    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];

    Then create the text to send - ie.

    $body = "Thankyou for submitting the following details -<br><br>First Name: " . $firstname . "<br>Last Name: " . $lastname;

    Then send an email to them (or you, or both) -

    mail($email, "Subject Line", $body);

    --------------

    Now if you want to respond when you recieve an email, it will depend on your email software (or host - easier) - You may be able to use message rules in Outlook Express to do it.

    Hope that helps.

  • #5
    Saz
    Saz is offline
    Regular Coder
    Join Date
    Jun 2005
    Posts
    277
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Question

    Many thanks for that Mark, (you say you're not too good on php, but I'm a complete beginner on it )

    Would that work, whether the sender used a form or mailto link?

    I've been trying to solve this one for a few months and would love some help from some of the members here.

    I didn't know that this could be covered in php, so will try there as well.

    Any help appreciated.

    Saz.

  • #6
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It will only work if you're using some kind of form for contact.

    Basically the information from the form gets sent to the script which then processes the fields - and in there you can do what I showed you, which is whatever you want really!, including sending them a confirmation email.

    If you want help writing up a form etc, and the script, I'll help if you like.

  • #7
    Saz
    Saz is offline
    Regular Coder
    Join Date
    Jun 2005
    Posts
    277
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Question

    Many thanks for the offer of help - I hope you won't regret it

    Ok, enquiries come either by email mailto links or by completing a form - one of the problems is that quite a few enquirers don't complete with the correct info, either by email or form, so need to do some sort of autoresponder that includes their enquiry and at the top it asks them to complete the relevant bits.

    Hope I've explained that clearly, but if not, just let me know and I'll post more.

    Much appreciated.


  • #8
    Regular Coder
    Join Date
    Jul 2005
    Location
    Halifax, Nova Scotia, Canada
    Posts
    392
    Thanks
    1
    Thanked 0 Times in 0 Posts
    You just have to specify that the variables cannot be null and then make it print something letting them know about the required fields using if else statements.

    I always get php syntax confused with other languages so I will not offer my attempt at the moment.
    Once I thought I was wrong but I was mistaken.

  • #9
    Regular Coder
    Join Date
    Nov 2004
    Location
    The Netherlands
    Posts
    551
    Thanks
    0
    Thanked 0 Times in 0 Posts
    CATdude about IE6: "All your box-model are belong to us"

  • #10
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try that script which mrruben5 posted, looks like it'll do what you want.

  • #11
    Saz
    Saz is offline
    Regular Coder
    Join Date
    Jun 2005
    Posts
    277
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Question

    Many thanks for the help on this my friends - the link that mrruben5 kindly put foward, doesn't do what I'm looking for - what I'm looking for is an autoresponder that not only emails back to them, what they emailed or sent by form, but also includes a message from me.

    Would it be easier to solve, if I tried to solve the mailto part first and then the form?

    Any help appreciated.

  • #12
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can use the script, just edit it for your own needs.

    Hang on I'll download it and try to show you...

  • #13
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay... so they get the form fields like so -

    $name = $_POST['name'];
    $email = $_POST['email'];
    $subject = $_POST['subject'];
    $text = $_POST['text'];


    So you want to add some text to the text they sent you?

    Change $text = $_POST['text']; to -

    $yourmessage = "Hi, thanks for sending me the following information, blah etc, your message goes here";

    $text = $yourmessage . "<br><br>" . $_POST['text'];

  • #14
    Regular Coder
    Join Date
    Jul 2005
    Location
    Halifax, Nova Scotia, Canada
    Posts
    392
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Heh my current client does all their own hosting in-house and doesn't even have php support. It is unfortunate because they don't realize that to be up to date with the form technology etc you need to have the server-side support.
    Once I thought I was wrong but I was mistaken.

  • #15
    Saz
    Saz is offline
    Regular Coder
    Join Date
    Jun 2005
    Posts
    277
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Question

    Many thanks Mark, this has got to be one of the most helpful, friendlier boards going

    Is that code for enquirers sending emails or forms? or both?

    Saz.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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