Re: HTML Email attachment problem

From: Date: Fri, 01 Feb 2002 01:29:38 +0000
Subject: Re: HTML Email attachment problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-83054@lists.php.net to get a copy of this message
check out one of many HTML email scripts on hotscripts.com. --- Peter Atkins <Peter.Atkins@nextcard.com> wrote: > All, > > I'm building a tool that takes form input and sends > out an html email with a > word doc attached. > It sends the text and html version of the email but > I can't open the > attachment. It opens blank. > > Anyone have a thought or two about this? > > <php snippet> > if ($attachment) { > $fp = fopen($attachment, "rb"); > $data = fread($fp, filesize($attachment)); > $data = chunk_split(base64_encode($data)); > fclose($fp); > > // add the MIME data > $str .= "--" . $boundary . "\r\n"; > $str .= "Content-Type: application/octet-stream; > name=\"" . > $attachment ."\"\r\n"; > $str .= "Content-Transfer-Encoding: base64\r\n"; > $str .= "Content-Disposition: attachment; > filename=\"" . $attachment > ."\"\r\n\r\n"; > $str .= $data . "\r\n"; > } > </php snippet> > > thanks, > -p > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > php-general-unsubscribe@lists.php.net > For additional commands, e-mail: > php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > ===== Anas Mughal anasmughal@yahoo.com anasmughal@hotmail.com Tel: 973-249-6665 __________________________________________________ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com

« previous php.general (#83054) next »