Linda,
There's a really nice MIME-email class for PHP called "PHP Mailer" here .
With it you could do something like:
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->From = "sender@mydomain.com";
$mail->FromName = "Sample Name";
$mail->Host = "smtp.mydomain.com";
$mail->Mailer = "smtp";
$mail->IsHTML(true);
$mail->AddEmbeddedImage("foo.gif", "my-attach", "foo.gif");
$mail->Body = 'Embedded Image: <img alt="PHPMailer" src="cid:my-attach"> Here
is an image!';
$mail->AddAddress("recipient@example.com");
if(!$mail->Send()){
echo "Message was not sent";
echo "Mailer Error: " . $mail->ErrorInfo;
}else{
echo "Message has been sent";
}
?>
It should be pretty simple to create a txt attachment to the email from your string -- and you don't have to create/delete files on the server.