Hi,
I've written a script that sends email to subscribers of a sites' newletter. That part was easy. Problem I'm having though, is when attachments are brought into it.
In Outlook, Yahoo, etc, the attachments show up correctly as a separate downloadable entity, however in my development environment, I'm using Linux with the Evolution 2.0.3 email client which seems to integrate the attachment into the body of the message, naturally as garbage.
I don't know what changes need to be made to the headers to make my mail script work with evolution... and perhaps other email clients...
Here is the portion of the code that generates the mail headers..
$mime_boundary = "[".md5(time())."]";
$headers = "From: {$company_name} <{$contact_email}>\n";
$headers .= "To: {$tonames[$index]} <{$toemails[$index]}>\n";
$headers .= "Reply-to: <{$contact_email}>\n";
$headers .= "X-Mailer: PHP/" . phpversion()."\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"{$mime_boundary}\"\n";
$headers .= "Content-Transfer-Encoding: 8bit\n\n";
$message = "--{$mime_boundary}\n";
$message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding: 8bit\n";
$message .= "Content-Disposition: inline\n\n";
$message .= "{$content}\n";
$message .= "--{$mime_boundary}\n";
$message .= "Content-Type: {$filetype}; name=\"{$filename}\"\n";
$message .= "Content-Transfer-Encoding: base64\n";
$message .= "Content-Description: {$filename}\n";
$message .= "Content-Disposition: attachment; filename=\"{$filename}\"\n\n";
$message .= "{$file}\n\n";
$message .= "--{$mime_boundary}--\n";