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.058 seconds

  I found "cook" two days ago. Played around with it for a day and then within a day got rid of two legacy applications in IBM Lotus Domino Notes and replaced them with "cook". It was really easy. A piece of cake. Actually it was even easier than cooking. Cooking involves more work than developing with "cook". What can I say about "cook"? Great application great price for what it delivers great forum with a lot of information and fast responses active and friendly community fast forward moving development cycle So what should I say "Monsieur Le Cook"? Keep the good work going it will lead to success. Having become a paying member in the words of Edith Piaf may I say ..... non rien de rien ... je ne regrette rien. Vive La France.
FK (JED)
         

Get Started