473,480 Members | 1,711 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to retrieve mails & attachment from mbox

5 New Member
i got problem with this
i m implementing web based mail system.
i want to access mbox and retrieve mail from it and display it on web page..

can anybody help me.
Mar 8 '07 #1
6 2768
ronverdonk
4,258 Recognized Expert Specialist
Please elaborate a bit more on your problem and show the code you have developed to tackle this requirement.

And show that code within php or code tags!!

Ronald :cool:
Mar 8 '07 #2
Watermark
5 New Member
i m implementing web based mail system using php.....
now i can send mail and attachments. i tried this
[php]
<?php
$to = "$name <$email>";
$from = "John-Smith <john.smith@domain.com>";
$subject = "Here is your attachment";

$fileatt = "/public_html/pdfs/mypdf.pdf";
$fileatttype = "application/pdf";
$fileattname = "newname.pdf";

$headers = "From: $from";

$file = fopen( $fileatt, 'rb' );
$data = fread( $file, filesize( $fileatt ) );
fclose( $file );

$semi_rand = md5( time() );
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";

$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";

$message = "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type: text/plain; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$message . "\n\n";

$data = chunk_split( base64_encode( $data ) );

$message .= "--{$mime_boundary}\n" .
"Content-Type: {$fileatttype};\n" .
" name=\"{$fileattname}\"\n" .
"Content-Disposition: attachment;\n" .
" filename=\"{$fileattname}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mime_boundary}--\n";

if( mail( $to, $subject, $message, $headers ) ) {
echo "<p>The email was sent.</p>";
}
else {
echo "<p>There was an error sending the mail.</p>";
}
}
?>[/php]

this sends attachment and encrypts it. also i want to retrieve mails from mbox
now i want to retrieve it and display it on webpage.......
can anybody help me plz......its my project

Read the Posting Guidelines on double threads and enclosing code within php or code tags!! - moderator
Mar 12 '07 #3
ronverdonk
4,258 Recognized Expert Specialist
That is a bit more complicated than sending emails with or without attachments.

Please have a look at the following, very useful, tutorials on building a web based email client. I am sure you'll find what you need.

Building-A-PHPBased-Mail-Client-part-1
Building-A-PHPBased-Mail-Client-part-2
Building-A-PHPBased-Mail-Client-part-3

Ronald :cool:
Mar 12 '07 #4
Watermark
5 New Member
sir your linked soln was nice.but i m not using any mail client .so what i want is accessing mails through php without that imap_* functions... i want to implement it like yahoomail.com ie no spcific client s/w required like outlook express.

i want to store mails on server & whenever user will request let them access that..
what exactly i want is parse mbox on server with php and retrieve mails plus attachments on webpage like yahoo,gmail web based systems.

plz give m a soln with example code.....
plzz help me
Mar 13 '07 #5
ronverdonk
4,258 Recognized Expert Specialist
Do not start a new thread for the same subject! I have merged the threads.

moderator
Mar 13 '07 #6
ronverdonk
4,258 Recognized Expert Specialist
sir your linked soln was nice.but i m not using any mail client .so what i want is accessing mails through php without that imap_* functions... i want to implement it like yahoomail.com ie no spcific client s/w required like outlook express.

i want to store mails on server & whenever user will request let them access that..
what exactly i want is parse mbox on server with php and retrieve mails plus attachments on webpage like yahoo,gmail web based systems.

plz give m a soln with example code.....
plzz help me
If my post with links did not meet your requirement, maybe you can have a look at the email class of www.phpclasses.org. That contains a lot of email solutions, client and web based.

These classes are free to download, change and use and I am sure you'll find code and samples that can be used by you. Look at Email classes

Ronald :cool:
Mar 13 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
8209
by: matt roberts | last post by:
Hi... I'm interested in using PHP to extract attachments from a standard unix ..mbox file...anybody done this or have a link to resources that might help? There is plenty on sending mail, but...
0
1689
by: chausan | last post by:
Update ++++++ All attchment scanned with norton anti-virus w/ yahoo mail service and they all reported infected with virus Worm.Automat.AHB. ======================================== From:...
1
1777
by: JAKE | last post by:
Hi, I made a funstion that checks a mail account, retrieves and stores the attachments in a folder on my website. This works great for .doc files but not for .pdf files.
4
9739
by: elyob | last post by:
Hi, I'm looking to setup an email system that will log into a catchall account, read to addresses and forward them to a different email address stored in a MySQL table. I may also allow the users...
6
2707
by: Anuradha | last post by:
Dear All How can i send mails using vb.net Thanx all
5
3593
by: tlyczko | last post by:
Hello, I've searched on toggling divs and didn't really find what I was looking for, I saved a bunch of different threads. I have a form with several different text boxes for things like dates,...
4
16660
prabunewindia
by: prabunewindia | last post by:
Hello everybody, here i am going to explain, how to get mails from Outlook express database and store in our own database(local) Initially you have to add the refference Outlook library10.0 or...
1
1413
by: sbettadpur | last post by:
Hi everybody, Iam struggling for retrieve mails from mail server using perl iam facing some problem in blow my code even i have the mails in my mailserver iam not getting the count of mails...
4
2601
by: stefano.troiani | last post by:
Hi, I have a web site that sends emails to some 17000 newsletter subscribers, the script takes about 5 minutes to complete the task, depending of the size of the attachment. The problem is that...
0
7044
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7045
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6741
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4483
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2985
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
182
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.