Re: [BULK] [PHP] I'm trying to sending an image via email

From: Date: Mon, 31 Dec 2007 00:42:58 +0000
Subject: Re: [BULK] [PHP] I'm trying to sending an image via email
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-266401@lists.php.net to get a copy of this message
> On Sun 30 Dec 07, tedd wrote: > > I'm trying to send an image via email (hmm, must be an echo). > > In any event, the following is my main-code (word, dude) and a part > > of the email I receive back. The image file IS there. > > Any suggestions as to what I'm doing wrong? > > > > -- the code -- > > $msg .= "Content-Disposition: attachment; > > filename=\"".$filename."\"".$eol.$eol; > > $msg .= $f_contents.$eol.$eol; On Mon 31 Dec 07, Eddie Dunckley wrote: > guess/think that should read: > $msg .= $f_contents.$eol. $boundary . "---" . $eol; > i.e. message needs a closing boundary terminated with either 2 or 3 > dashes (cant remember off-hand). oops .. didnt read properly. $msg .= $f_contents . $eol . '--' . $mime_boundary . "---" . $eol.$eol; send yourself an email with an attachment and view the email source and compare with your program output. or you could just google for MIME.class site:*.phpbuilder.net and download and use it like require_once("MIME.class"); // check if parm bcc is in lib, think its not. $msg = new MIME_mail($from, $to,$cc,$bcc, $subject); $msg->fattach($filename); // parms = $path, $description, $contenttype=OCTET, $encoding=BASE64, //$disp='inline' etc, view the mime class to see options $msg->send_mail(); -- Eddie Dreams are free, but you get soaked on the connect time.

« previous php.general (#266401) next »