The SMTP module always sets certain headers which cannot be unset. See the following lines from Drupal\smtp\Plugin\Mail\SMTPMailSystem
:
$headers['Sender'] = $from;
$headers['Return-Path'] = $from;
$headers['Reply-To'] = $from;
This is to make it compatible with Drupal core which does the same from what I can tell.
For more control, you can use the module PHPMailer SMTP instead which explicitly unsets the Return-Path
header to comply with RFC 5321.
It also makes no assumptions about which extra headers should be present (beyond the required ones) and only sets them if they are added elsewhere.
The following would work if the case of the headers match:
function mymodule_mail_alter(&$message) {
unset($message['headers']['Sender']);
unset($message['headers']['Reply-To']);
}
Alternatively, the following would unset headers regardless of case:
function mymodule_mail_alter(&$message) {
$message['headers'] = array_change_key_case($message['headers']);
unset($message['headers']['sender']);
unset($message['headers']['reply-to']);
}
PHPMailer SMTP is for sending email only and does not do any HTML formatting so you'd also need to use a module such as MIME Mail for that purpose.
Disclaimer: I am the author of PHPMailer SMTP.