BOARDS

planetluc.com discussion board

all about the planetlu.com scripts

You are not logged in.

Announcement

I had to clean the boards due to massive spam. Actually i deleted everything /-one after 1st Oct 2008. It was the only way to get this spam out of the boards. So i'm sorry for all serious users who registered/posted meanwhile.

#1 23-02-2008 03:43:22

jeet123
Member
Registered: 23-02-2008
Posts: 11

auto responder

hi,
is it possible to have auto responder for FormPro ??

thanks

Offline

 

#2 25-02-2008 18:54:51

sidtheduck
Moderator
From: down by the water
Registered: 14-07-2006
Posts: 515
Website

Re: auto responder

this can be done but it will only work if you have the email as mandatory (thus why it isn't already built in to FormPro).  Also, the "Thank You" page part of FormPro would do the same thing as an autoresponder.  But, would you like an autoresponder to send an email with the Thank You message as well as displaying it on submitting the form?


If it looks like a duck, and quacks like a duck, we have at least to consider the possibility that we have a small aquatic bird of the family anatidae on our hands.                ~Douglas Adams~

Offline

 

#3 25-02-2008 18:59:07

jeet123
Member
Registered: 23-02-2008
Posts: 11

Re: auto responder

yeah I would like to send autoresponder to send an email with the Thank You Message (message should be changeable)

thanks

Offline

 

#4 25-02-2008 19:00:30

sidtheduck
Moderator
From: down by the water
Registered: 14-07-2006
Posts: 515
Website

Re: auto responder

jeet123 wrote:

yeah I would like to send autoresponder to send an email with the Thank You Message (message should be changeable)

More changeable (separate?) than the $fpCfg['txtThankyou']?


If it looks like a duck, and quacks like a duck, we have at least to consider the possibility that we have a small aquatic bird of the family anatidae on our hands.                ~Douglas Adams~

Offline

 

#5 25-02-2008 19:24:22

jeet123
Member
Registered: 23-02-2008
Posts: 11

Re: auto responder

yeah if possible,
but i need to send it to email....

eg.
thanks, we have recieved ur email, there is no need to replay this email, someone will get to you soon, bla bla

Offline

 

#6 25-02-2008 20:25:02

sidtheduck
Moderator
From: down by the water
Registered: 14-07-2006
Posts: 515
Website

Re: auto responder

okay, I have a fix for you.  It's a little bit of code (and you have to alter the existing code just a little).  Hopefully it will work for posting to the board.

So, first open 'config.inc.php' and add the following lines (editing them as you want them to be):

$fpCfg['ThankyouEmailSubject']= "Thank you for emailing mysite.com";
$fpCfg['ThankyouEmailFromAddress']= "noreply@mysite.com";
$fpCfg['ThankyouEmailMessage']= "Thank you for sending your message through mysite.com.\nWe have received your message and will respond to it as soon as possible";


Then, open 'formpro.php' and find the following lines (starting at line 197 on the default download):

if ($field[3] == "email"){
   $message .= "mailto:".$_REQUEST[$field[1]];
   $mail->From = $_REQUEST[$field[1]];

and change it to read:

if ($field[3] == "email"){
   $from = $_REQUEST[$field[1]];
   $message .= "mailto:".$from;
   $mail->From = $from;

Then, add the following code below that a ways (starting at line 224 or 225 on the default download):

// send mail
if ($mail->Send() !== true){
   echo $mail->ErrorInfo;
}
       
if (!empty($from)){
   $response = new PHPMailer();
   $response->Subject = $fpCfg['ThankyouEmailSubject'];
   $response->IsMail();
   $response->FromName = $fpCfg['ThankyouEmailFromAddress'];
   $response->AddAddress($from);
         
   $remessage = $fpCfg['ThankyouEmailMessage']."\n\n";
   $remessage.= "You wrote:\n";
   for ($i = 0; $i < strlen($fpCfg['emailSubject']); $i++) $remessage .= "*";
   $remessage.= "\n".$message;
   $response->Body = $remessage;
   if ($response->Send() !== true){
      echo $response->ErrorInfo;
   }
}

       
echo $fpCfg['txtThankyou'];

That should do it for you (at least testing it quickly on my server it worked, though I didn't test the errors at all).  Let me know if you run into any problems.

Last edited by sidtheduck (25-02-2008 20:26:20)


If it looks like a duck, and quacks like a duck, we have at least to consider the possibility that we have a small aquatic bird of the family anatidae on our hands.                ~Douglas Adams~

Offline

 

#7 25-02-2008 23:01:37

jeet123
Member
Registered: 23-02-2008
Posts: 11

Re: auto responder

thanks  it work, but have problem

it now sending email twice to recipient, (one email coming empty just only with Subject) plus also showing Thank You message twice after user fill up and send form....

thanks

Offline

 

#8 25-02-2008 23:06:09

sidtheduck
Moderator
From: down by the water
Registered: 14-07-2006
Posts: 515
Website

Re: auto responder

jeet,

Only copy the bold parts above.  Sorry I didn't explain better.  The non-bold portion was only included for reference (to know where you are at in the code).


If it looks like a duck, and quacks like a duck, we have at least to consider the possibility that we have a small aquatic bird of the family anatidae on our hands.                ~Douglas Adams~

Offline

 

#9 25-02-2008 23:16:41

jeet123
Member
Registered: 23-02-2008
Posts: 11

Re: auto responder

thanks it work perfect....

you are the great.... thanks

- Jeet

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson

 
 
© 2003-2010 by planetluc.com · Bachtelstrasse 104 · CH-8400 Winterthur | Support | Login |