--$mimeboundary
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: base64
$textbody
Content-Type: text/html; charset=UTF-8
$htmlbody
--$mimeboundary--