|
Re: mail() with images *embedded*: msg#03603php.general
At 08:44 24.05.02, you wrote: I used: Thanks! That's quite what I have, but the images are attached below the message, and the images in the message itself are broken :( Here's some code: I'm reading the message into the variable $html_body... $html_body = "This is a multi-part message in MIME format.\n" . "--$boundary\n" . "Content-Type: text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding:8bit\n" . "\n" . " Then comes the html part, the picture embedded as follows... <img src=\"cid:01.jpg\" width=\"600\" height=\"75\"></td> ... after the html I have: $file = "01.jpg"; $path = "/usr/www/users/muinar/rtj/i/newsletter-title.jpg"; $fp = fopen( $path,"r" ); $attachment = fread( $fp,filesize( $path ) ); $attachment = chunk_split( base64_encode( $attachment ) ); fclose( $fp ); $html_body .= "--$boundary\n" . "Content-Type: image/jpeg; name=\"$file\"\n" . "Content-Transfer-Encoding: base64\n" . "Content-ID: <$file>\n" . "Content-Disposition: inline; filename=\"$file\"\n" . "\n" . $attachment . "\n" . "\n\n"; The encoding works, the message looks fine, just the images are not embedded but attached. Aaargh :( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Mailing list software recommendation?, Tom Rogers |
|---|---|
| Next by Date: | SMARTCARDS - PHP + MySQL, PHPCoder |
| Previous by Thread: | Re: mail() with images *embedded*, Jason Wong |
| Next by Thread: | Re: mail() with images *embedded*, Jason Wong |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |