Jump to content

I'm trying to add an email auto responder into a existing php script


macrat101

Recommended Posts

I'm trying to get my php form to send a simple auto responder to the persons email that submitted the form. Something like "Thanks we received your info". I don't know how to integrate that into my existing script. Below are the configurable parts of the php. The form works perfectly ... just want to add the auto respond function. Thanks!

_______________________________________________________________________________________________________

 

 

<?php

 

$d = date("m-d-y H:i:s");

 

 

 

/*  *************  Begin Configuration  *************  */

$relocate = "http://www.xxxxx.com/";  // insert your relocation url here

$home = "http://www.xxxxx.com/";

$MOVE_TO_PATH = '/home/content/xxxxx/html/FileUpload/';

$PATH_TO_DIR = 'http://www.xxxxx.com/FileUpload/';

 

 

 

$sender_name = "Order";

$sender_email = "me@xxxxx.com";

$mailheaders = "Content-Type: text/plain; charset=us-ascii\nFrom: $sender_name <$sender_email>\nReply-To: <$sender_email>\nReturn-Path: <$sender_email>\nX-Mailer: PHP";

 

 

 

 

//$to = "me@xxxxx.com";

$to = "me@xxxxx.com";

$subject = "Order";

 

 

$success_block = "<p>Thank you for submitting your information. We will review your information and get back to you within a day or two.</p><br><br>";

 

/*  *************  End Configuration  *************  */

 

 

// mail

if ($send != "false") {

  mail($to, $subject, $msg, $mailheaders);  // mail sent to admin

  header("Location: $relocate");

}

?>

Link to comment
Share on other sites

It looks like you already did it. Is it not working? I would do if(!empty($send)) and set $send according to a GET/POST variable coming from your form.

 

I think by auto-responder you mean "confirmation email". To me at least, an auto-responder is an email that automatically replies when someone sends an email to a particular address. You can do that with PHP too, assuming you have qmail you just put this into the account's .qmail-default file:

 

| true
| /usr/bin/php /path/to/autoresponder/code/autoresponder.php

 

Qmail will pass in the variables you need to see who sent the original message, etc. As long as you use mail() in it, whenever an email comes into that account PHP will generate a dynamic response. I get the feeling this isn't what you were asking but it's an awesome tool so you might want to take note of it anyway :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.