Here… https://www.php.net/manual/en/function.imap-mail-compose.php I’ve found an example of imap_mail()
using for multiparts message…
$mail = str_replace("\r","",imap_mail_compose($envelope, $body));
imap_mail($to, $subject, '', $mail);
But it causes error: imap_mail() message not set.
Now to solve it, I just give one space (’ ') instead of empty string. Is there some other variant?