What's Here?
- Members: 131,942
- Replies: 470,212
- Topics: 72,879
- Snippets: 2,538
- Tutorials: 664
- Total Online: 1,897
- Members: 75
- Guests: 1,822
Who's Online?
|
I quickly delevoped this for a email based auction script I'm working on now and then.
It is similar to the php5 ftp class found at php.net/ftp but is written with php4.3 in mind.
|
Submitted By: snoj
|
|
|
Rating:
|
|
Views: 6,584 |
Language: PHP
|
|
Last Modified: June 21, 2005 |
Instructions: Read the documentation at php.net/imap for more info on imap function.
I have not looked at every function. But for most you do not need to include the resource varible as this class does it automaticly.
Example:
imap_headers($_imap_resource);
//becomes
$imap_object->headers(); |
Snippet
<?php
class imap {
var $handle;
function imap($add, $user, $pass) {
$this->handle = imap_open($add, $user, $pass);
return true;
}
function __call($function, $arguments, &$return) {
//funny thing about php4.3.x is that you need &$return but you never need to put it in the call for the method....hmmm...
// Prepend the imap resource to the arguments array
// Call the PHP function
} else {
die('"imap_'. $function. '" does not exist.');
}
return true;
}
}
//Small example usage.
$imap_object = new imap("{mail.someserver.com/pop3:110/notls}INBOX", 'username', 'password');
?>
Copy & Paste
|
|
|
Reference Sheets
Bye Bye Ads
Free DIC T-Shirt
Related Sites
Monthly Drawing
Partners
Top Contributors
Top 10 Kudos This Month
|