This is working code for just text:
PHP Code:
<?php
$to = "dgudenau@larosaequip.com";
$subject = "Drawing";
$message = "there";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
$headers .= "talking some message\r\n";
mail($to, $subject, $message, $headers)
?>
This is working code for just an image attachment:
PHP Code:
<?php
$to = "dgudenau@larosaequip.com";
$subject = "Drawing";
$message = "message";
$headers = "MIME-Version: 1.0\r\n";
$file_array = array(0=>array('file'=>'/dwf.gif',
'mimetype'=>'image/gif',
'filename'=>'myfile.gif'));
foreach($file_array as $val)
{
$file = fopen($val['file'],'rb');
$data = fread($file,filesize($val['file']));
fclose($file);
$headers .= "Content-Type: image/gif; name=myfile\r\n";
$headers .= "Content-Transfer-Encoding: base64\r\n";
$headers .= "Content-Disposition: attachment\r\n";
$headers .= chunk_split(base64_encode($data));
}
mail($to, $subject, $message, $headers)
?>
Now, i cant figure out how to create the multipart/mixed mail.
After the MIME-Version header i've added line:
$headers .= "Content-Type: multipart/mixed; boundary=\"12345\"\r\n";
Then before the individual content-type headers i've added line:
$headers .= "--12345\r\n";
Finally before i call the mail function i've added line:
$headers .= "--12345--\r\n";
This sends me an email with no message and a text file containing the first five letters of my $message variable (messa).
Sorry about the first sloppy post.
Help me.....thank you...... dan
Bookmarks