Forums

Auto responder

hans8020 05 Jun, 2008
Hello,

I want to create an auto reponse e-mail to the submitter with a simple Thank you message and the filled in data from the form. I read the topics about this and stumbled upon several simmilar problems. There was a link from GreyHead to a topic with the right code for me but the link didn't work. I work with Joomla 1.5 and apparently I needed a different piece of PHP at the end to get it work ...but nada.. This is my code:
<?php 
$recipient = $_POST[Email]; 
$html_message = "<p>Bedankt voor het invullen van ons contactformulier. 
Uw vraag wordt zo spoedig mogelijk behandeld</p>"; 
$subject = $subject"; 
JUtility::sendMail( $from, $fromname, $recipient, 
    $subject, $html_message, true ); 
?>


Yes, this will only cover the thank you message and not display the results of the form, but I thought I would start easy on this.... Does any-one have a link to the right topic or code?
GreyHead 05 Jun, 2008
Hi Hans8020,

To send the form data to the submitter you just need to include 'Email' (no quotes) in the box on the Special Fields tab.

To make this a personalised message you need to create an email template in the Form Code tab - and select Email template on the General tab.

To show a thank you page you need to put some HTML in the 'OnSubmit after' box.

You only need to use the code you have posted if you want to send *different* emails to the submitter adn the admin.

Bob

PS If you point me to the broken link I can fix it - probably it's got & instead of & in it somewhere.



You only need to
hans8020 05 Jun, 2008
Thank you very much! I will find teh broken link and send it to you.
hans8020 05 Jun, 2008
Hello again,

I wasn't very clear in my question. Yes, I do have to send an e-mail to the e-mail adress of the owner (where the formresults will be processed) and second, a reply to the submitter ..so I do need the php codes to put in the onsubmit after area since the e-mail template will be used for the mail to the owner. I can't find the topic with the broken link but there was someone who solved this problem, so can you help me again?
GreyHead 05 Jun, 2008
Hi hans8020,

OK then the code you have posted looks to me like the correct code to send an email in Joomla 1.5.x???

Please take a Form Backup from the Form Manager and email it to me at the address in my sig and I'll take a look.

Bob
hans8020 06 Jun, 2008
Thank you for your interest, My joomla version = 1.5.3 Dutch

I will attach the backup. [file name=contact.cfbak size=17467]http://www.chronoengine.com/images/fbfiles/files/contact.cfbak[/file]
GreyHead 06 Jun, 2008
Hi Hans,

There were two small typos in your mail code. Here's the revised version:
 <?php 

$recipient = $_POST['Email'];  // added quotes round Email

$html_message = "<p>Bedankt voor het invullen van ons contactformulier.  
Uw vraag wordt zo spoedig mogelijk behandeld</p>"; 
 
$subject = $subject; // removed "  

JUtility::sendMail( $from, $fromname, $recipient,  
    $subject, $html_message, true ); 

echo $html_message; // added this line 

?>
I've also added a last line which will display the message on the 'Thank You' page. To see this please remove the ReDirect URL.

Bob

PS Something weird with the forums again (or maybe my browser) - I can't get line-breaks to stick :-(
hans8020 06 Jun, 2008
Thanks Bob,

I"ll try this code.

Greetings,

Hans
hans8020 06 Jun, 2008
Hello Bob,

I found the broken link here in your first reply...the link (here) starts the common forum page.

Greetings,

Hans
GreyHead 06 Jun, 2008
Hi Hans,

Fixed thank you.

Bob
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger