JFactory/getMailer
$mail =& JFactory :: getMailer ( ) ; $config =& JFactory :: getConfig ( ) ; $mail -> addRecipient ( $config -> getValue ( 'config.mailfrom' ) ) ; $mail -> setSubject ( 'Test message' ) ; $mail -> setBody ( 'This is an example email to test the Joomla! JFactory::getMailer() method. Please ignore it' ) ; if ( $mail -> Send ( ) ) { echo "Mail sent successfully." ; } else { echo "An error occurred. Mail was not sent." ; }