So I am able to connect to the pop3 server, log in, and check how many messages there are. I am having a problem with server responses though.
In the following code, I don't understand why on the marked line I get a response. Right after I get the server response after sending the password I am able to fgets() and receive the info as if i had just sent the 'stat' command. But I didn't send it at all. Is this just an automated response I should expect, or a setting with the server?
Also, I never seem to get a response from the server when sending the 'list' command. I'm assuming I don't get a response because the browser just waits until timeout at that part of the script.
I am new to sockets and decided to learn them using pop3 as a project. Any help is appreciated.
Code: <?php
$fp=fsockopen("pop.1and1.com", 110, $errno, $errstr, 30);
if($fp){
echo 'Connected!
';
$username="USER email@edited.comrn";
$password="PASS mypasswordrn";
$us=fwrite($fp, $username, strlen($username));
$ur=fgets($fp);
echo 'Username sent, server response: '.$ur.'
';
$ps=fwrite($fp, $password, strlen($password));
$pr=fgets($fp);
echo 'Password sent, server response: '.$pr.'
';
//Question refers to this line
$res=fgets($fp);
$parts=explode(" ", $res);
echo $parts[4].' messages on server
';
//I don't get a response from this part.
$get=fwrite($fp, 'list');
$msg=fgets($fp);
echo $msg;
}
else{
echo 'Failed Connecting!
';
}
?>
Logged
Quote from: blmg911 on October 10, 2008, 03:29:28 PM<embed src='.wav' autostart='true' loop='false'
width='2' height='0'>
</embed>
i found that ERMMMMM thats called PHP!!!
Help with writing "$" with fopen
I just can't get my syntax correct. Could someone help me please? I am trying to write a connect file for inclusion as part of the installation routine for an app I am working on. I need this line to
How to show more than 1 users with this code...
Hello,i have a table that shows users only if I, as Administrator, want to be shown. But its showing just 1 user and i want to show at least 4. If i copy the code, or use loop, its showing the same
question about header() security
is is safe to just use the header() function to redirect someone if they are, say, not logged in? or should i always put a die() function underneath the header() function?
animation progress while uploading files?
Hello, i have some website form to upload few files to server. i want to put some gif animation while the files is uploading using AJAX. Any ideas?
ALV grid with 2 headers
Hi Gurus,
SAP Logon Failed
I tried to login to SAP through MMC.
PHP mail() rejected by SMTP
I'm currently working on a newsletter application which is installed on a windows 2003 server running apache. This server is scheduled to run a script every 5 minutes that will send an email to 10
AutoChoosing a CSS file based on URL
Hey everyone,I have a site that has multiple URLs and CSS files.Based on the URL that the user goes to I want that CSS file to load.This is what I have thus far in the <head> of my
Registration
ok so i have a site where people can register and login which works now thanks to someone on here that pointed out my error :-)Now my users click my links they can view the content without logging in,
Php If in MySql query (hiding labels if a field is empty)
Okay, I've been trying to do this for a while, and I'm finally going to ask for help so I can get the simple answer and feel like an idoit .Anyway, I'm building a dynamic driver profile page for my