I've inherited some legacy code that sends e-mail as follows:
$headers .= chunk_split(base64_encode($mailbody));
mail("my@email.com", $subject, "", $headers);
It looks strange because it uses no body, and encodes everything in base64 and puts it in the header. Because I'm hitting limits with the default send mail on my host, I'm switching to SMTP with PEAR's Mail package as follows
$mime->setTXTBody($body);
$mime->setHTMLBody($body);
$mimebody = $mime->get();
$mimeheaders = $mime->headers($headers);
$smtp->send($to, $mimeheaders, $mimebody);
An unexpected consequence is that for some reason gmail is now reporting my messages as spam. How do I get base64 encoding working with php and pear?