Hi,
I am trying to get field values in section "On Submit code - after sending email:" I tried following ways
and then send mail using following code, i tried three of the above ways to get field
but in noway its sending mail which i intend to send so that i can alert whenever someone submits form it can be confirmed to the email id whom is used.
Hope to get some reply/help from someone,
Thanks
Sachin
I am trying to get field values in section "On Submit code - after sending email:" I tried following ways
$fname=$_POST['firstName'];
$fname=$_POST[firstName];
$fname=$_REQUEST['firstName'];
and then send mail using following code, i tried three of the above ways to get field
$title=$_POST['title'];
$fname=$_POST['firstName'];
$lname=$_POST['lastName'];
$eMail=$_POST['email'];
$msg="Dear $title $fname $lname, \n\n
......
.....
Thank you,\n
with kind regards\n
...";
$from="me@mysite.~~~";
$fromname="Sachin";
$subj="Thank you";
JUtility::sendMail($from, $fromname, $eMail, $subj, $msg, true);
but in noway its sending mail which i intend to send so that i can alert whenever someone submits form it can be confirmed to the email id whom is used.
Hope to get some reply/help from someone,
Thanks
Sachin
Hi Sachin,
The code in your second box looks OK. Exactly what isn't working?? Is $msg not created correctly? Is the email not sent?
Bob
The code in your second box looks OK. Exactly what isn't working?? Is $msg not created correctly? Is the email not sent?
Bob
Hi Bob,
Thanks for the quick reply,
Yes $msg is completely configured well and ok, but it seems like the system doesnt process the code of second box at all. and i need to send thanking mail with alerting to the email address of form submitter.
Sachin
Thanks for the quick reply,
Yes $msg is completely configured well and ok, but it seems like the system doesnt process the code of second box at all. and i need to send thanking mail with alerting to the email address of form submitter.
Sachin
Hi Sachin,
Try using this code to get an error message from sendMail
Bob
Try using this code to get an error message from sendMail
$email_sent = JUtility::sendMail($from, $fromname, $eMail, $subj, $msg, true);
if ( $debug ) {
if ( $email_sent )
echo "Email sent ";
if ( ! $email_sent )
echo "Email not sent<br />";
echo $email_sent;
}
I think in Joomal 1.5 $email_sent will have an error message and not just 'false'
Bob
Hi Bob,
That also didnt work but i figured out the problem,
When i was adding Form URL to redirect after submission of the form it wasnt processing the code for mail which i wanted.
So i removed Form URL and kept it blank, then below my code i just put line of redirection where i wished to redirect user after submission.
Code for redirect i put ...
And now its working well..🙂
Thanks for your great help and instant replies of the message
Sachin
That also didnt work but i figured out the problem,
When i was adding Form URL to redirect after submission of the form it wasnt processing the code for mail which i wanted.
So i removed Form URL and kept it blank, then below my code i just put line of redirection where i wished to redirect user after submission.
Code for redirect i put ...
$mainframe->redirect('thankyou.html');
And now its working well..🙂
Thanks for your great help and instant replies of the message
Sachin
This topic is locked and no more replies can be posted.