This is current alternative method, not a longer method
if u use
================================
$this->execPieceByName('ff_InitLib');
date_default_timezone_set('Asia/Kuala_Lumpur');
$name = ff_getSubmit('name');
$contact_no = ff_getSubmit('contact_no');
$email = ff_getSubmit('email');
$remarks = "Contact Form";
$remarks .= "\nMessage: ".ff_getSubmit('message');
======================================
but unable get the field value, u can try below method
=======================================
// Get the application object
$app = \Joomla\CMS\Factory::getApplication();
// Get the input object
$input = $app->input;
// Get submitted form data
$formData = $input->post->getArray();
// Extract individual field values from the array
$name = isset($formData['ff_nm_name'][0]) ? $formData['ff_nm_name'][0] : '';
$email = isset($formData['ff_nm_email'][0]) ? $formData['ff_nm_email'][0] : '';
$contact_no = isset($formData['ff_nm_contact_no'][0]) ? $formData['ff_nm_contact_no'][0] : '';
$message = isset($formData['ff_nm_message'][0]) ? $formData['ff_nm_message'][0] : '';
// Prepare remarks
$remarks = "Contact Form";
$remarks .= "\nName: " . $name;
$remarks .= "\nEmail: " . $email;
$remarks .= "\nContact No: " . $contact_no;
$remarks .= "\nMessage: " . $message;
but the fromData['name'], the name should according to ur form's name
Inspect to check the name of the field
Put [0] is ensure it can get the first one
Summary:
This is joomla get input function. If the system not support $this->execPieceByName('ff_InitLib'); method due to unknow reason, u can try this method first.