I am attempting to make an attached to a mailing.
When I use the below code, it just prints all the headers in the body of the e-mail. Any help would be appreciated 🙂
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$data = chunk_split(base64_encode($license));
$headers = "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
$message = "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type:text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$message .= "\n\n";
$message .= "--{$mime_boundary}\r\n" .
"Content-Type: text/plain;\r\n" .
" name=\"license.txt\"\r\n" .
//"Content-Disposition: attachment;\n" .
//" filename=\"{$fileatt_name}\"\n" .
"Content-Transfer-Encoding: base64\r\n\r\n" .
$data . "\n\r\n" .
"--{$mime_boundary}--\r\n";