# Fill mail object with data $destinationEmails = preg_split('/[ ,;]/', $dfcontact['destinationMail']); foreach ( $destinationEmails as $destinationMail ) { if ( $destinationMail != '' ) { $mail->addRecipient( $destinationMail ); } } $mail->setSender( array( $app->getCfg('mailfrom'), $app->getCfg('fromname') ) ); if ( !empty( $email ) ) { $mail->addReplyTo( array($email, $name) ); } $mail->setSubject( $subject ); # Set mail body if ( !empty( $dfcontact['htmlMails'] ) ) { $mail->isHTML( true ); $mail->Body = utf8_encode($html); $mail->AltBody = utf8_encode($text); } else { $mail->Body = utf8_encode($text); } # Try to send email and display result $sendResult = $mail->Send(); if ( is_bool($sendResult) && $sendResult == true ) { echo '
' . JText::_( 'COM_DFCONTACT_FORM_MAIL_SUCCESS') . '
' . "\n"; if ( !empty( $dfcontact['displayUserInput'] ) ) { echo '' . JText::_( 'COM_DFCONTACT_FORM_MAIL_SUBMITTED_VARS') . '
' . "\n"; echo $sentVars; } } else { echo '' . JText::_( 'COM_DFCONTACT_FORM_MAIL_ERROR') . '
' . "\n"; echo $backlink; } } } else {