Send an email to person submitting form

snowball77 23 Jun, 2008
Hi,
I have what I thought was relatively easy question, but searching through the forums I am getting very lost.

I would like to send an email to the person who submitted a form. I would like to send it automatically after they pressed submit.

Where can I add this?
thanks,
A
snowball77 23 Jun, 2008
thought I better add,
This is what I put in the OnSubmit Code:
<?php  
$recipient = $_POST[Email];  
$html_message = "<p>Thank your for your entry in the Rosnay Wine Hamper Draw</p>";  
$subject = $subject";  
JUtility::sendMail( $from, $fromname, $recipient,  
    $subject, $html_message, true );  
?>
I tested it...I am didn't get an email.

I would like to add a subject too.

I am pretty sure i am missing something.

Can anyone help please?
GreyHead 23 Jun, 2008
Hi snowball77,

That code looks OK for Joomla 1.5.x but it needs to be in the 'OnSubmit afrer email' box as the variables aren't defined when the 'OnSubmit before email' box is run.

You can add a subject by setting a value for $subject.

Bob
snowball77 23 Jun, 2008
I am using Joomla 1.0.xxx

I did put it in the OnSubmit after email section.

Excuse my ignorance but do I have to add anything else at all to that code??

Also, to add a subject line....what do I do.

of course I am mainly concerned with actually getting it to work?
GreyHead 23 Jun, 2008
Hi snowball77,

I just spotted an extra " in the subject line. Please try this
<?php   
$recipient = $_POST[Email];
   
$html_message = "<p>Thank your for your entry in the Rosnay Wine Hamper Draw</p>";
  
$subject = "Subject for the email";   
JUtility::sendMail( $from, $fromname, $recipient, $subject, $html_message, true );   
?>
Bob
snowball77 23 Jun, 2008
That didn't work I am afraid
I pasted the code into the Onsubmit after section and now all I see is a blank page after I press submit.
I havn't received an email either.
Is there something else I am supposed to do to make sure the the page gets redirected properly and i send a response email?
GreyHead 23 Jun, 2008
Hi snowball77,

A blank page is what you'd expect, the code doesn't display anything.

Is the normal results email working OK? If not, please check this FAQ

Bob
snowball77 23 Jun, 2008
I have no problem sending emails.
The results are being sent to the administrator as expected.
I simply want another email to be sent to the responder.

I don't want a blank page after the form is submitted, but the thankyou page that is always displayed.

What am I doing wrong?

Please help!
GreyHead 24 Jun, 2008
Hi snowball77,

What is the 'thankyou page that is always displayed'? ChronoForms doesn't display a thank you page normally.

Do you have a redirect url in your form? In that case you may have the buggy version of chronocontact.php

Bob
snowball77 24 Jun, 2008
Hi there,
Thanks for replying.
I do have a redirection page set up and it works just fine without me adding this new code.
If I have a buggy version, can I fix it?
Can you help me fix it?
Thanks,
Amanda
GreyHead 24 Jun, 2008
Hi Amanda,

Please downlaod this file unzip it and copy the chronocontact.php to replace the exisitng file in the components/com_chronocontact folder.

Bob
facers 24 Jun, 2008
Excuese me, I am a curiosity. I had tried download the file and replace the chronocontact.php on the components/com_chronocontact folder. But the send an mail to end-user function still didn't work. If you need any information about the testing, please let me known. Tks.

P.S I sure my email function is work on the joomla and can send the mail to admin via ChronoForms.
snowball77 24 Jun, 2008
Hi,
I downloaded that and THANK GOD I backed up the previous version because when I tried the new one,I couldn't even test the form as I got a "restricted access error"

You said a blank page is what I should expect in the code, is there something I can write in the code to get the redirection page to work?

I don't understand what is going on.

I just want an email to be sent to the responder. Is that too hard? I just want an email and the page to be redirected. Surely there is some simple code to write where I am trying to write it.

Can someone please help. I am dubious to use the new version given here even if it can be configured to remove the restricted access. I dont' think I have a buggy version, I think I am not writing the right code.

please help
GreyHead 25 Jun, 2008
Hi snowball77,

Let's backtrack a bit here. Which Joomla version are you using? The download file was for Joomla 1.5.x and shouldn't give any errors with that. It won't work if you are on Joomla 1.0.x

Is your site on-line - can I look at it?

What was the 'restricted access' message, do you remember the words used so that I can see when Joomla calls it?

Bob
snowball77 25 Jun, 2008
Hi Again,
I am on Joomla 1.0.xx
The site is avn.org.au/library
GreyHead 26 Jun, 2008
Hi snowball77,

I'm sorry, that was a Joomla 1.5 file and will certainly mess up yout Joomla 1.0

I'll sort out a Joomla 1.0 version when I have a few minutes.

Bob
snowball77 26 Jun, 2008
Ok Thanks,
I am looking forward to getting this issued resolved and if anyone else has experienced this and solved it I would be grateful to hear how you rectified it.
This topic is locked and no more replies can be posted.