Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Coding example quest... 02 Aug 2012 15:59 #2963

I am looking for some coding example inside the component to implement a button that will send a form.
Any other coding example is for sure welcome... !
Any suggestion ? Thanks.

Please Log in or Create an account to join the conversation.

Last edit: by admin.

Re: Coding example quest... 05 Aug 2012 18:34 #3003

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
Should have asked that in the "coding inside your component" section...
Send a mail on saving a form ?
Then you have to implement it in the controller, in the function save()
  $mailer =& JFactory::getMailer();
  $config =& JFactory::getConfig();
  $sender = array(
	  $config->getValue( 'config.mailfrom' ),
	  $config->getValue( 'config.fromname' ));
  $mailer->setSender($sender);
  $mailer->Encoding = 'base64';
  $body = "blabla <br />";
  $body .= "blabla <span style = 'font-weight:bold; color:red;'>\"" . $variable . "\"</span><br />
  $mailer->setSubject('Your Subject');
  $mailer->setBody($body);

  $send =& $mailer->Send();
  if ( $send !== true ) {
	  echo 'Error sending email: ' . $send->message;
  } else {
	  $app = JFactory::getApplication();
	  $app->enqueueMessage('Mail Sent');
  }
The following user(s) said Thank You: admin

Please Log in or Create an account to join the conversation.

Last edit: by VeCrea.

Re: Coding example quest... 05 Aug 2012 18:56 #3009

So greatful... many thanks thats' a very good point.

About the category: :silly:
Yes I fact I agree but in fact I miss to set it up right at the first post
and afterward there is no way to move from forum category to another...

Please Log in or Create an account to join the conversation.

Last edit: by e-struct.

Re: Coding example quest... 05 Aug 2012 19:01 #3011

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
Yeah i saw you had the same problem on other posts ;)
Still needing help on the mail thing, or are you cool now ?
The following user(s) said Thank You: admin

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.061 seconds

Real time saver and great Component Builder tool ! I have been developing with J-Cook Pro Component Builder for several months now and can say with all honesty that this product/service is second to none. The product is feature rich and is being improved and added to all the time. Do yourself a favor if you need to build a Joomla! Component then you can do no wrong in trying the product. You will save on time and effort while being able to deliver your project on time. J-Cook pro does the hard work for you you then have the freedom to fully customise the end result for your own needs. 

One word: Awesome.
Edwardcox (JED)
         

Get Started