Trouble Sending Thank You Email with Joomla 1.5

Post any questions you may have here

Trouble Sending Thank You Email with Joomla 1.5

Postby lewmaster on Mon May 12, 2008 5:07 pm

Hi,

I've been using this component on Joomla 1.x now for quite some time and it's been working great. I have a new 1.5 project and I need a form that will send a thank you email to the user once they have filled out the form, as well as the normal email that the admin gets. I've been using the following code in the OnSubmit After area in Joomla 1.x and it works fine:

Code: Select all
<?php
$recipient = $_POST['email'];
$html_message = "Message Here";
$subject = " Subject Here";
mosMail($from, $fromname, $recipient, $subject, $html_message, true, NULL, NULL, NULL, NULL, NULL );
?>


However in Joomla 1.5 I get the following Error when using this code:

Fatal error: Call to undefined function: mosmail() in /homepages/17/d204522867/htdocs/components/com_chronocontact/chronocontact.php(562) : eval()'d code on line 5

Can anyone help me figure out what I need to change to get this working again?

Thanks!
lewmaster
Fresh Boarder
 
Posts: 5
Joined: Mon Oct 15, 2007 11:07 pm

Re:Trouble Sending Thank You Email with Joomla 1.5

Postby admin on Tue May 13, 2008 3:41 pm

Yes, replace mosmail with :

Code: Select all
JUtility::sendMail( $mailfrom, $fromname, $email, $subject, $message, true );


Cheers

Max
ChronoForms/ChronoConnectivity/ChronoComments Developer Thanks for using our components!
If you have any problems with any extension please tell us.
If you like any of our extensions please post a review at Joomla.org
Want users to submit their content to your website ? try Submit Story
Want to list/edit/delete your data ? try ChronoConnectivity
Want to have stylish AJAX comments ? try ChronoComments
User avatar
admin
Platinum Boarder
 
Posts: 2323
Joined: Mon Aug 14, 2006 5:29 am

Re:Trouble Sending Thank You Email with Joomla 1.5

Postby finc on Tue May 13, 2008 6:19 pm

I have added it in Joomla 1.5 (Legacy: 1.0)
Code: Select all
<?php
$recipient = $_POST['email'];
$html_message = " Message";
$subject = " Subject";
JUtility::sendMail( $mailfrom, $fromname, $email, $subject, $message, true );
?>

but its not sending me anything :blush:
finc
Fresh Boarder
 
Posts: 3
Joined: Tue May 13, 2008 11:11 am

Re:Trouble Sending Thank You Email with Joomla 1.5

Postby GreyHead on Tue May 13, 2008 7:27 pm

You've set $html_message in the preamble but used $message in the function. I think this should still give you an empty message though.

Ah, and $recipient should be $email !

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3253
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Trouble Sending Thank You Email with Joomla 1.5

Postby lewmaster on Tue May 13, 2008 7:32 pm

Thanks for the fix guys, it worked great. Just one more small problem - if I add a URL to the Redirect URL field under the Form URLs tab, the thank you email will not send. I do still get the admin email. When I leave that field blank, I get both emails. Is there any way I can use this code and still have both emails send normally?

Thanks for the help!
lewmaster
Fresh Boarder
 
Posts: 5
Joined: Mon Oct 15, 2007 11:07 pm

Re:Trouble Sending Thank You Email with Joomla 1.5

Postby GreyHead on Wed May 14, 2008 10:50 am

Hi lewmaster,

A Redirect URL shouldn't stop the emails being sent - it is the last thing that ChronoForms does (after the 'OnSubmit after email' code).

Puzzled?? Please take a Form Backup of your form from the CF Forms Manager and email it to me at the address in my sig.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3253
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany


Return to ChronoForms Questions & Answers

Who is online

Users browsing this forum: maqsood, Yahoo [Bot] and 2 guests