Re: attach file problem.
| From: | Holm Puder | Date: | Wed, 01 Aug 2001 15:30:01 +0000 |
| Subject: | Re: attach file problem. | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-8617@lists.php.net to get a copy of this message | ||
Try this:
$Answer = fread ........
$MailText =" This is the Text";
$fileName = "your-name.htm";
$mail_header ="";
// Send mail to customer
/* Generiere einen Boundary */
$boundary = strtoupper(md5(uniqid(time())));
/* Mail-Header using MIME-Mail-Header */
/* (siehe http://www.php3-forum.de/mime_mail.htm) */
$mail_header .= "MIME-Version: 1.0";
$mail_header .= "\nfrom: xxx@xxx.com";
$mail_header .= "\nContent-Type: multipart/mixed;
boundary=$boundary";
$mail_header .= "\n\nThis is a multi-part message in MIME format
";
/* Mail-Text */
$mail_header .= "\n--$boundary";
$mail_header .= "\nContent-Type: text/plain";
$mail_header .= "\nContent-Transfer-Encoding: 8bit";
$mail_header .= "\n\n" . $MailText;
/* Your File */
$mail_header .= "\n--$boundary";
$mail_header .= "\nContent-Type: text/html; name=\"$fileName\"";
/* Read from Array $contenttypes the right MIME-Typ */
$mail_header .= "\nContent-Transfer-Encoding: 8Bit";
$mail_header .= "\n\n$Answer";
/* End */
$mail_header .= "\n--$boundary--";
----------------------- CUT ----------
Holm