Connecting Tech Pros Worldwide Forums | Help | Site Map

Sample of reading mail

Intos
Guest
 
Posts: n/a
#1: Sep 24 '08
Is there some code example how to read/send e-mail with PHP ?
Beside this i need to pull out the attachment and to save it in some
directory.

Any idea?



Sjoerd
Guest
 
Posts: n/a
#2: Sep 24 '08

re: Sample of reading mail


Intos wrote:
Quote:
Is there some code example how to read/send e-mail with PHP ? Beside
this i need to pull out the attachment and to save it in some directory.
How do you receive the email? POP3, mbox, IMAP, MAPI, Webmail, Maildir?

Sending mail can be done with mail().
Captain Paralytic
Guest
 
Posts: n/a
#3: Sep 24 '08

re: Sample of reading mail


On 24 Sep, 06:52, "Intos" <in...@mail.comwrote:
Quote:
Is there some code example how to read/send e-mail with PHP ?
Beside this i need to pull out the attachment and to save it in some
directory.
>
Any idea?
Anything wrong with the first 2 articles listed in the Google search
of:
php read email attachment
???
J2Be.com
Guest
 
Posts: n/a
#4: Sep 24 '08

re: Sample of reading mail



"Intos" <intos@mail.comha scritto nel messaggio
news:gbckil$mgv$1@localhost.localdomain...
Quote:
Is there some code example how to read/send e-mail with PHP ?
Beside this i need to pull out the attachment and to save it in some
directory.
>
Any idea?
I cannot write down a full sample, that would be a bit long.

You should parse the received message in the part of the attachments, detect
the transfer encoding and decode the attached file(s).

A document about decoding the Attachments
http://pages.prodigy.net/michael_santovec/decode.htm

A decent attachment decoder (from scratch) will require you hours of work.

You can give a look at portions of code of the various php webmail
(uebimiau, nocc, atmail, etc) scripts
or crms like sugarcrm. They all should include a mime recognition and the
complete parsing/decoding of the emails.


Regards
L. A. Iarrusso

http://www.j2be.com


Closed Thread