I'm an italian student and I'm trying to develop a php mail client. It's from a long time that I still having issues to visualize the e-mail's list from my INBOX folder. Time ago i solved this problem by modify one file (I don't remember which one now) to allow imap functions to work from my Apache. Googling, I've found to modify something in php.ini or in sendmail.ini, i tried, but it was not what i need.
What happends:
It returns a white page. No errors. Nothing. It happens when I insert (by using a form) my username (xxx@xxx.xxx), password and click the button to send the informations to the imap server. I've checked the cryptography (SSL, ecc..) the port number, of course, but it seems to be all right.
I've simplified my code from OOP to theese few lines to make more simple for you to understand what I'm gonna do:
cnf.php - configurations file.
- Code: Select all
<?
$username = "my@account.mail";
$password = "my_passw";
$server = "imap.provider.com";
$conn = @imap_open("{".$server.":port/cryptography}INBOX",$username, $password);
?>
index.php - it should shows the INBOX folder.
- Code: Select all
<?php
set_time_limit(120);
@include 'cnf.php';
$headers = @imap_headers($conn);
$var = "0";
if ($headers == 0) {
echo "Nessun messaggio in arrivo.<br />\n";
}
else {
while (@list ($k, $val) = @each ($headers)) {
$var = $var+1;
$f_over = @imap_fetch_overview($conn, $var, 0);
while(@list($k, $v) = @each($f_over)) {
echo "<b>Sent by:</b> ".$v->from."<br>\n
<b>Object:</b>" .$v->subject."<br>\n
<b>Date:</b> ".$v->date."<br />\n
<a href=\"show.php?id=".$var."\">Read</a> :: // don't care about this
<a href=\"delete.php?id=".$var."\">Delete</a><br /><br />\n"; // don't care about this too
}
}
}
@imap_close($conn);
?>
More informations:
I have the latest version of xampp;
Xampp is running on Windows 8 Professional 64;
I'm developing using PHP5;
I'm testing with my gmail's account;
Hope theese informations are sufficient.
Thank you. Have a nice evening.