Re: [PHP] how to read emails with php
On 4 December 2012 19:24, Farzan Dalaee farzan.dal...@gmail.com wrote: Warning: imap_open() [function.imap-open]: Couldn't open stream mail.mydomain.net:143/pop3INBOX in C:\xampp\htdocs\mail.php on line 6 this is my code $host = 'mail.mydomain.net:143/pop3'; $user = 'x...@mydomain.net'; $password = 'myPassword'; $mailbox = {$host}INBOX; ^^^ PHP interprets that as insert $host in string and removes the curly braces. Try $mailbox = {mail.mydomain.net:143/pop3}INBOX; Cheers, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to read emails with php
On Tue, Dec 4, 2012 at 12:24 PM, Farzan Dalaee farzan.dal...@gmail.com wrote: Warning: imap_open() [function.imap-open]: Couldn't open stream mail.mydomain.net:143/pop3INBOX in C:\xampp\htdocs\mail.php on line 6 Warning: imap_check() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\mail.php on line 10 Notice: Unknown: Can't open mailbox mail.mydomain.net:143/pop3INBOX: no such mailbox (errflg=2) in Unknown on line 0 this is my code $host = 'mail.mydomain.net:143/pop3'; I'm not hugely familiar with PHP's imap -- but are you trying to connect using the IMAP port (143) but with the POP3 protocol? POP3 is port 110... $user = 'x...@mydomain.net'; $password = 'myPassword'; $mailbox = {$host}INBOX; $mbx = imap_open($mailbox , $user , $password); You might consider checking if $mbx === false here, since if imap_open, it will return false. Then check imap_last_errors/imap_errors to see what the error(s) is(are). if (false === $mbx) exit (can't connect to $mailbox: . imap_last_error() . PHP_EOL); $check = imap_check($mbx); On 12/4/12, Jonathan Sundquist jsundqu...@gmail.com wrote: What does it say when you call imap_errors or imap_last_error? On Tue, Dec 4, 2012 at 10:02 AM, Farzan Dalaee farzan.dal...@gmail.comwrote: i dont have access to log files on server On Azar 14, 1391, at 5:51 PM, Daniel Brown wrote: On Tue, Dec 4, 2012 at 8:10 AM, Farzan Dalaee farzan.dal...@gmail.com wrote: hi guys i want to open an email content ( subject ,body , attachment ) with php i use imap_php but its wont connect to host what should i do? thanx Start by finding out why it won't connect. Check the logs on the server if you can, that's always the best place to look first. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to read emails with php
hi guys i want to open an email content ( subject ,body , attachment ) with php i use imap_php but its wont connect to host what should i do? thanx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to read emails with php
On Tue, Dec 4, 2012 at 8:10 AM, Farzan Dalaee farzan.dal...@gmail.com wrote: hi guys i want to open an email content ( subject ,body , attachment ) with php i use imap_php but its wont connect to host what should i do? thanx Start by finding out why it won't connect. Check the logs on the server if you can, that's always the best place to look first. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to read emails with php
i dont have access to log files on server On Azar 14, 1391, at 5:51 PM, Daniel Brown wrote: On Tue, Dec 4, 2012 at 8:10 AM, Farzan Dalaee farzan.dal...@gmail.com wrote: hi guys i want to open an email content ( subject ,body , attachment ) with php i use imap_php but its wont connect to host what should i do? thanx Start by finding out why it won't connect. Check the logs on the server if you can, that's always the best place to look first. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to read emails with php
What does it say when you call imap_errors or imap_last_error? On Tue, Dec 4, 2012 at 10:02 AM, Farzan Dalaee farzan.dal...@gmail.comwrote: i dont have access to log files on server On Azar 14, 1391, at 5:51 PM, Daniel Brown wrote: On Tue, Dec 4, 2012 at 8:10 AM, Farzan Dalaee farzan.dal...@gmail.com wrote: hi guys i want to open an email content ( subject ,body , attachment ) with php i use imap_php but its wont connect to host what should i do? thanx Start by finding out why it won't connect. Check the logs on the server if you can, that's always the best place to look first. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to read emails with php
Warning: imap_open() [function.imap-open]: Couldn't open stream mail.mydomain.net:143/pop3INBOX in C:\xampp\htdocs\mail.php on line 6 Warning: imap_check() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\mail.php on line 10 Notice: Unknown: Can't open mailbox mail.mydomain.net:143/pop3INBOX: no such mailbox (errflg=2) in Unknown on line 0 this is my code $host = 'mail.mydomain.net:143/pop3'; $user = 'x...@mydomain.net'; $password = 'myPassword'; $mailbox = {$host}INBOX; $mbx = imap_open($mailbox , $user , $password); $check = imap_check($mbx); On 12/4/12, Jonathan Sundquist jsundqu...@gmail.com wrote: What does it say when you call imap_errors or imap_last_error? On Tue, Dec 4, 2012 at 10:02 AM, Farzan Dalaee farzan.dal...@gmail.comwrote: i dont have access to log files on server On Azar 14, 1391, at 5:51 PM, Daniel Brown wrote: On Tue, Dec 4, 2012 at 8:10 AM, Farzan Dalaee farzan.dal...@gmail.com wrote: hi guys i want to open an email content ( subject ,body , attachment ) with php i use imap_php but its wont connect to host what should i do? thanx Start by finding out why it won't connect. Check the logs on the server if you can, that's always the best place to look first. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to read emails with php
Try removing the call to the inbox and try getting a list of all the folders using imap_listmailbox($host, *); On Tue, Dec 4, 2012 at 12:24 PM, Farzan Dalaee farzan.dal...@gmail.comwrote: Warning: imap_open() [function.imap-open]: Couldn't open stream mail.mydomain.net:143/pop3INBOX in C:\xampp\htdocs\mail.php on line 6 Warning: imap_check() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\mail.php on line 10 Notice: Unknown: Can't open mailbox mail.mydomain.net:143/pop3INBOX: no such mailbox (errflg=2) in Unknown on line 0 this is my code $host = 'mail.mydomain.net:143/pop3'; $user = 'x...@mydomain.net'; $password = 'myPassword'; $mailbox = {$host}INBOX; $mbx = imap_open($mailbox , $user , $password); $check = imap_check($mbx); On 12/4/12, Jonathan Sundquist jsundqu...@gmail.com wrote: What does it say when you call imap_errors or imap_last_error? On Tue, Dec 4, 2012 at 10:02 AM, Farzan Dalaee farzan.dal...@gmail.comwrote: i dont have access to log files on server On Azar 14, 1391, at 5:51 PM, Daniel Brown wrote: On Tue, Dec 4, 2012 at 8:10 AM, Farzan Dalaee farzan.dal...@gmail.com wrote: hi guys i want to open an email content ( subject ,body , attachment ) with php i use imap_php but its wont connect to host what should i do? thanx Start by finding out why it won't connect. Check the logs on the server if you can, that's always the best place to look first. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to read emails with php
Same error I think its need something else for opening service like ssl setting or somthing like that Or this host im using block imap or pop3 access Best Regard Farzan Dalaee On Dec 4, 2012 10:03 PM, Jonathan Sundquist jsundqu...@gmail.com wrote: Try removing the call to the inbox and try getting a list of all the folders using imap_listmailbox($host, *); On Tue, Dec 4, 2012 at 12:24 PM, Farzan Dalaee farzan.dal...@gmail.comwrote: Warning: imap_open() [function.imap-open]: Couldn't open stream mail.mydomain.net:143/pop3INBOX in C:\xampp\htdocs\mail.php on line 6 Warning: imap_check() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\mail.php on line 10 Notice: Unknown: Can't open mailbox mail.mydomain.net:143/pop3INBOX: no such mailbox (errflg=2) in Unknown on line 0 this is my code $host = 'mail.mydomain.net:143/pop3'; $user = 'x...@mydomain.net'; $password = 'myPassword'; $mailbox = {$host}INBOX; $mbx = imap_open($mailbox , $user , $password); $check = imap_check($mbx); On 12/4/12, Jonathan Sundquist jsundqu...@gmail.com wrote: What does it say when you call imap_errors or imap_last_error? On Tue, Dec 4, 2012 at 10:02 AM, Farzan Dalaee farzan.dal...@gmail.comwrote: i dont have access to log files on server On Azar 14, 1391, at 5:51 PM, Daniel Brown wrote: On Tue, Dec 4, 2012 at 8:10 AM, Farzan Dalaee farzan.dal...@gmail.com wrote: hi guys i want to open an email content ( subject ,body , attachment ) with php i use imap_php but its wont connect to host what should i do? thanx Start by finding out why it won't connect. Check the logs on the server if you can, that's always the best place to look first. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to read emails with php
It is very likely that the host you are using is blocking access to that port. Also depending on the host you are going to you may need to enable imap as well. On Tue, Dec 4, 2012 at 12:44 PM, Farzan Dalaee farzan.dal...@gmail.comwrote: Same error I think its need something else for opening service like ssl setting or somthing like that Or this host im using block imap or pop3 access Best Regard Farzan Dalaee On Dec 4, 2012 10:03 PM, Jonathan Sundquist jsundqu...@gmail.com wrote: Try removing the call to the inbox and try getting a list of all the folders using imap_listmailbox($host, *); On Tue, Dec 4, 2012 at 12:24 PM, Farzan Dalaee farzan.dal...@gmail.comwrote: Warning: imap_open() [function.imap-open]: Couldn't open stream mail.mydomain.net:143/pop3INBOX in C:\xampp\htdocs\mail.php on line 6 Warning: imap_check() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\mail.php on line 10 Notice: Unknown: Can't open mailbox mail.mydomain.net:143/pop3INBOX: no such mailbox (errflg=2) in Unknown on line 0 this is my code $host = 'mail.mydomain.net:143/pop3'; $user = 'x...@mydomain.net'; $password = 'myPassword'; $mailbox = {$host}INBOX; $mbx = imap_open($mailbox , $user , $password); $check = imap_check($mbx); On 12/4/12, Jonathan Sundquist jsundqu...@gmail.com wrote: What does it say when you call imap_errors or imap_last_error? On Tue, Dec 4, 2012 at 10:02 AM, Farzan Dalaee farzan.dal...@gmail.comwrote: i dont have access to log files on server On Azar 14, 1391, at 5:51 PM, Daniel Brown wrote: On Tue, Dec 4, 2012 at 8:10 AM, Farzan Dalaee farzan.dal...@gmail.com wrote: hi guys i want to open an email content ( subject ,body , attachment ) with php i use imap_php but its wont connect to host what should i do? thanx Start by finding out why it won't connect. Check the logs on the server if you can, that's always the best place to look first. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to read emails with php
On Tue, Dec 4, 2012 at 1:44 PM, Farzan Dalaee farzan.dal...@gmail.com wrote: Same error I think its need something else for opening service like ssl setting or somthing like that Or this host im using block imap or pop3 access Per list rules, please don't top-post. Some things to consider: 1.) Incorrect domain name. Be sure the domain is spelled correctly and is registered. 2.) System not configured to serve IMAP. 3.) Firewall blocking access to port 143. 4.) Host down. Try pinging the domain. If you get a response back, try either using Telnet to connect to the domain on port 143 or using an email client with the same access details and credentials you're trying to use in your code. At this point, it's evident that it's not a PHP problem, so you'll need to research the rest on your own. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to read emails with php
I think so, so my code is correct and it should be working, thanks you all for your time Best Regard Farzan DalaeeJonathan Sundquist jsundqu...@gmail.com wrote:It is very likely that the host you are using is blocking access to that port. Also depending on the host you are going to you may need to enable imap as well. On Tue, Dec 4, 2012 at 12:44 PM, Farzan Dalaee farzan.dal...@gmail.com wrote: Same error I think its need something else for opening service like ssl setting or somthing like that Or this host im using block imap or pop3 access Best Regard Farzan Dalaee On Dec 4, 2012 10:03 PM, Jonathan Sundquist jsundqu...@gmail.com wrote: Try removing the call to the inbox and try getting a list of all the folders using imap_listmailbox($host, *); On Tue, Dec 4, 2012 at 12:24 PM, Farzan Dalaee farzan.dal...@gmail.com wrote: Warning: imap_open() [function.imap-open]: Couldn't open stream mail.mydomain.net:143/pop3INBOX in C:\xampp\htdocs\mail.php on line 6 Warning: imap_check() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\mail.php on line 10 Notice: Unknown: Can't open mailbox mail.mydomain.net:143/pop3INBOX: no such mailbox (errflg=2) in Unknown on line 0 this is my code $host = 'mail.mydomain.net:143/pop3'; $user = 'x...@mydomain.net'; $password = 'myPassword'; $mailbox = {$host}INBOX; $mbx = imap_open($mailbox , $user , $password); $check = imap_check($mbx); On 12/4/12, Jonathan Sundquist jsundqu...@gmail.com wrote: What does it say when you call imap_errors or imap_last_error? On Tue, Dec 4, 2012 at 10:02 AM, Farzan Dalaee farzan.dal...@gmail.comwrote: i dont have access to log files on server On Azar 14, 1391, at 5:51 PM, Daniel Brown wrote: On Tue, Dec 4, 2012 at 8:10 AM, Farzan Dalaee farzan.dal...@gmail.com wrote: hi guys i want to open an email content ( subject ,body , attachment ) with php i use imap_php but its wont connect to host what should i do? thanx Start by finding out why it won't connect. Check the logs on the server if you can, that's always the best place to look first. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to read emails with php
On 12/04/2012 05:10 AM, Farzan Dalaee wrote: hi guys i want to open an email content ( subject ,body , attachment ) with php i use imap_php but its wont connect to host what should i do? thanx As others have suggested, try connecting using telnet from the same server you are running the PHP from. Here is a page I wrote a while back that shows you how to do this. http://bendsource.cmsws.com/serverSetup -- Jim Lucas http://www.cmsws.com/ http://www.cmsws.com/examples/ http://bendsource.cmsws.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php