Joomla. JUtility::sendMail. Sample on php

$author = JFactory::getUser();
$usrmail = $author->email;                     

 $config    = JFactory::getConfig();
 $fromname    = $config->get('fromname');
 $mailfrom    = $config->get('mailfrom');
 $sitename    = $config->get('sitename');
       
 $subject = stripslashes(JText::_('COM_COMPONENT_MAIL_SUBJECT'));
 $message = nl2br(sprintf(stripslashes(JText::_(COM_COMPONENT_MAIL_MESSAGE')), JURI::root(), $title, $description));
                           
                   
  JUtility::sendMail($from, $fromname, $recipient, $subject, $body, $mode=0, $cc=null, $bcc=null, $attachment=null, $replyto=null, $replytoname=null);
                
Scroll to Top
Ads: