ok, I think I managed to solve this problem:
first, in my controller (components/com_myComponent/controllers/myController.php) I add this function:
function notify ($recipient){
# get e-mail config from Joomla
$config =& JFactory::getConfig();
$from = array(
$config->getValue( 'config.mailfrom' ),
$config->getValue( 'config.fromname' )
);
# Set some variables for the email message
$subjectAdmin = "Admin e-mail subject";
$subjectUser = "User e-mail subject";
$bodyAdmin = "Admin e-mail content ...";
$bodyUser = "User e-mail content ...";
$toAdmin = $config->getValue( 'config.mailfrom' );
$toUser = $recipient;
# Invoke JMail Class
$mailerAdmin = JFactory::getMailer();
$mailerUser = JFactory::getMailer();
$mailerAdmin->setSender($from);
$mailerUser->setSender($from);
$mailerAdmin->addRecipient($toAdmin);
$mailerUser->addRecipient($toUser);
$mailerAdmin->setSubject($subjectAdmin);
$mailerUser->setSubject($subjectUser);
$mailerAdmin->setBody($bodyAdmin);
$mailerUser->setBody($bodyUser);
# If you would like to send as HTML, include this line; otherwise, leave it out
$mailerAdmin->isHTML();
$mailerUser->isHTML();
# Send once you have set all of your options
$mailerAdmin->send();
$mailerUser->send();
}
then in function save() before this line:
$this->setRedirect(FirmyHelper::urlRequest($vars));
I add this:
$this->notify($_POST['adres_email']);
where 'adres_emial' is a field that contains the user e-mail.
Of course we can add another function parameters.
And in the body of an email send more information from the form.
I hope that everything is fine.
Maybe this will help someone.
I I use this tutorial to find out how to Joomla send e-mail:
ostraining.com/howtojoomla/how-tos/devel...our-joomla-extension