PHP/IMAP/HTML email + attachements

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fractalvibes
Forum Contributor
Posts: 335
Joined: Thu Sep 26, 2002 6:14 pm
Location: Waco, Texas

PHP/IMAP/HTML email + attachements

Post by fractalvibes »

I mayhave posted something a while back - just now getting back to this.

Given that I have a site that allows users to view their email accounts online that were established on this server - using IMAP functions to access their list of emails and view individual emails and also reply.

1.) I send email to a test account there from home via Outlook - all ok except what they see is quite cluttered with such as what you'll see below.

2.) Is there any IMAP or other function that can clean that up a bit and just present the email,even if it sent as HTML email

3.) Same question for attachments commonly sent with emails? i.e.
images, word docs, pdfs, etc.

All examples I have seen show some interesting things about Sending email in MIME format, but Not about Handling this in a web mail application.

Any ideas appreciated!

Phil J.
Example below...

--------------------------------- see below ----------------------------
This is a multi-part message in MIME format.

------=_NextPart_000_0016_01C30DD1.0FCC9EA0
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0017_01C30DD1.0FCC9EA0"


------=_NextPart_001_0017_01C30DD1.0FCC9EA0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

A test with an attachment

------=_NextPart_001_0017_01C30DD1.0FCC9EA0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
------------------------------------------------------------------

--- and --
------=_NextPart_001_0017_01C30DD1.0FCC9EA0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

-- and finally the best part below.... --
A test with an=20
attachment

------=_NextPart_001_0017_01C30DD1.0FCC9EA0--

------=_NextPart_000_0016_01C30DD1.0FCC9EA0
Content-Type: image/jpeg;
name="soyuz.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="soyuz.jpg"

/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPAAA/+4ADkFkb2JlAGTAAAAAAf/b
AIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoKDBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxsc

---- and so forth for the image...
Post Reply