Merci pour votre...
--$boundary-- EOT; mail($user->getEmail(), "Confirmation d'inscription", $message, [ 'From' => '[email protected]', 'Reply-To' => '[email protected]', 'Content-type' => "Content-Type: " ."multipart/alternative;boundary=$boundary", 'MIME-Version' =>'1.0', ]); class Mailer { public function send(User $to, string $subject, string $txt, string $html): bool { $message = <<getEmail(), $subject, $message, [ 'From' => '[email protected]', 'Reply-To' => '[email protected]', 'Content-type' => "Content-Type: multipart/alternative;...", 'MIME-Version' =>'1.0', ]); } } $mailer = new Mailer(); $mailer->send($user, 'Votre inscription', /*...*/);