Forum Moderators: coopster
I know that the mail is dumped as tiny files in a directory deeper then my public_html root folder (and I do have FTP access to it). I did some reading and I am convinced that using imap is the way to go for webmail versus pop (as I don't know much about them).
So I found out about imap_open however I was receiving the error message Call to undefined function imap_open() and upon further investigation discovered that the module is not installed on my live server.
I was also messing around with RoundCube (per someone's suggestion) and it claims to successfully connect to my server's imap service. Just to confirm it I slightly modified the credentials intentionally and it claims to not be able to connect. However using Advanced Find & Replace to see if the imap_open function existed in the script it found no instances (using *.* as the file type mask).
This meant that somehow RoundCube was connecting successfully to my server's imap service without using the imap_open function. When I posted intentionally bad credentials I received an error message about fsockopen. I can only presume that imap is only one type of "connection?" that passes through this socket?
What is most important for me initially is to know if I'm going in the correct direction to be able to eventually attain a list of emails on my server so that I can program PHP to allow me to read my own email. Sending mail isn't the issue for me. I'm also not interested in super complex code, classes, and such. I'm interested in learning the core parts and then optimizing my code. ;)
Also what else might I need to be concerned about or that people new to fsockopen commonly make mistakes with?
- John
$fp = @fsockopen("localhost", 993, $mail, $pass, 5);
if($fp) echo "<p>success</p>";
else echo "<p>failure: ".$errstr.'</p>';
...I'm not sure what to use however to actually interact with the mail after I've connected to the server?
Effectively: how do I figure what my "hands" are and how to use them?
- John
What you are looking for is contained within the
lib/imap.inc file as part of the RoundCube distribution. Take a peek and it should get you moving along.
2.) *looks at the file size* Holy cow 67KB?! Don't get me wrong...I don't want to offload the work on to someone else but could you give me a slight hint if at all possible please? This was written by a guy on a whole different level than where I'm at right now! I just wrote my first extensive MySQL script that spans almost 500 lines...but this...geez! o.0
I only see two instances of fsockopen but I'm having a very difficult time figuring out what connects to what (I guess my working version of classes in PHP is very different from this guys!) Is this->a_class in example?
- John
>> module is not installed on my live server
I'm assuming that you got this all worked out since you last posted here? Anyway, if you are serious about writing your own IMAP applications, I would suggest enabling this module on your server for the future.
>> Is this->a_class in example?
Not sure what you mean by this.