My auto response email script doesn't work

I have a rather old site which was written long ago, in the PHP4 days.
Recently I have re-coded this site so that it can work now in a server with PHP7. Most part of the site works now, but I have a form which sends out emails to me and an auto response to the user, and the auto response part doesn’t work, i.e. it doesn’t send emails to the user.
This code part would be responsible to send emails:

<?PHP
ini_set('SMTP', 'mail.mydomain.com');
ini_set('smtp_port', '26');

###### Email to Form Owner ######
$emailSubject = FilterCChars("Email to owner");
$emailBody = chunk_split(base64_encode("<html>\n"
 . "<head>\n"
 . "<title></title>\n"
 . "</head>\n"
 . "<body>\n"
 . "Name: $FTGq1_name<br/>\n"
 . "Destination: $FTGq2_destination<br/>\n"
 . "Month: $FTGq3_month<br/>\n"
 . "Day: $FTGq4_day<br/>\n"
 . "Email: $FTGq5_email<br/><br/>\n"
 . "</body>\n"
 . "</html>"))
 ini_set('sendmail_from', "$FTGq5_email");
 $emailTo = '[email protected]';
 $emailFrom = FilterCChars("$FTGq5_email");
 $emailHeader = "From: $emailFrom\n"
  . "Reply-To: " . FilterCChars($FTGq5_email) . "\n"
  . "MIME-Version: 1.0\n"
  . "Content-Type: text/html; charset=\"utf-8\"\n"
  . "Content-Transfer-Encoding: base64\n"
  . "\n";
 mail($emailTo, $emailSubject, $emailBody, $emailHeader);

 
###### Confirmation Email to User ###### 
$confEmailTo = FilterCChars($FTGq5_email);
$confEmailSubject = FilterCChars("Email to user");
$confEmailHeader = "From: [email protected]\n"
 . "MIME-Version: 1.0\n"
 . "Content-Type: text/html; charset=\"utf-8\"\n"
 . "Content-Transfer-Encoding: base64\n"
 . "\n";
$confEmailBody = chunk_split(base64_encode("<html>\n"
 . "<head>\n"
 . "<title></title>\n"
 . "</head>\n"
 . "<body>\n"
 . "Thank you for your enquiry.<br/>\n"
 . "<strong>Details of your enquiry</strong><br/>\n"
 . "Name: $FTGq1_name<br/>\n"
 . "Destination: $FTGq2_destination<br/>\n"
 . "Your email address: $FTGq5_email<br/>\n"
 . "</body>\n"
 . "</html>"))
 . "\n";
mail($confEmailTo, $confEmailSubject, $confEmailBody, $confEmailHeader);
?>

What’s wrong with it? It worked in the past.

Sponsor our Newsletter | Privacy Policy | Terms of Service