473,602 Members | 2,764 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Retrieve mails from mailserver

121 New Member
Hi everybody,

Iam struggling for retrieve mails from mail server using perl
iam facing some problem in blow my code
even i have the mails in my mailserver iam not getting the count of mails
only iam getting count as -1
what was the problem can any body reply back

look at my code
Expand|Select|Wrap|Line Numbers
  1. $pop = new Mail::POP3Client(USER => $username,PASSWORD => $passwd, HOST=> $host,PORT=> $port,TIMEOUT =>20,AUTH_MODE => 'BEST',DEBUG => 1) ||  die "cannot establish connection with the pop3 mail server $host, $!";
  2. print "Connection  established";
  3. print $pop->Count();
  4. print "<table align=center>";
  5. for ($i=1; $i<=$pop->Count(); $i++)
  6. {
  7.     foreach ( $pop->Retrieve( $i ) )
  8.     {
  9.         print "<tr><td>$_</td></tr>\n";
  10.     }
  11. }
  12. print "</table>";
  13.  


thanking you.

Regards,
shiva krishna
Jul 2 '08 #1
1 1422
numberwhun
3,509 Recognized Expert Moderator Specialist
In looking at the page on CPAN for Mail::POP3Clien t , I found the following line:

Expand|Select|Wrap|Line Numbers
  1. new returns a valid Mail::POP3Client object in all cases. To test for a connection failure, you will need to check the number of messages: -1 indicates a connection error.
  2.  
The -1 that you are getting is saying that there is a problem with the connection. I would check and make sure that you can login with the ID/Password you are specifying. Also, I would ensure that the mail system you are connecting to supports POP3.

Regards,

Jeff
Jul 11 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3118
by: Alexander Franksmann | last post by:
Hello, I'm going to write a anti-spam-program based on a Whitelist. "If the mail sender is found in the database, my program should move the mail into another mailbox" The mailserver fetched the mails from the clean pop3-account. The problem is a problem because the function imap_move() can only move mails from one folder in the mailbox into another folder. I hope someone could help me.
3
6942
by: mihir | last post by:
does any one have a clue as to how to send a mail via jsp/servlets.
3
1775
by: Mal Reeve | last post by:
Hello, I am looking for an easy way to retrieve a file from a given website.. I am building an app that will retrieve a .csv file then TRANSFER text it into a table for further processing.. Any pointers would be greatly appreciated. TIA
3
1823
by: Richard Thornley | last post by:
Hello, I was just been given a project and I have some questions on how to accomplish the first part of the task. If a user sends an email to a specific email address I need to detect that
1
1152
by: sympatico | last post by:
Hi, I am new to vb.net, i want to receive email from my mailserver through vb.net, could you pls tell me how to do that. Thanks
3
6096
by: mark.macumber | last post by:
This issue is really annoying me, I dont know why its happening. I did a PHP site for a client and it uses the php mail() function. The site is now live and works fine. It seems that whenever a user who is internal to the site as in, if they use the site from within the network that the site is served. The mail function fails with: Warning: mail() : Failed to connect to mailserver at "theServer" port 25, verify your "SMTP" and...
2
1881
by: SharpSmith | last post by:
hi all i have a very specific question regarding emails sending and googling doesn't help me is a way exists to send email using .NET framework (System.Web.Mail or something else) and have the "from" address to be X but if the message is bounced from not existing address or whatever, it will be returned to adress Y ? i tried to work by approach described in that article :
6
2792
by: Watermark | last post by:
i got problem with this i m implementing web based mail system. i want to access mbox and retrieve mail from it and display it on web page.. can anybody help me.
4
2611
by: stefano.troiani | last post by:
Hi, I have a web site that sends emails to some 17000 newsletter subscribers, the script takes about 5 minutes to complete the task, depending of the size of the attachment. The problem is that sometime it takes so much time that is difficult to know if something is going wrong, and sometimes the script terminates with timeout. I thought to solve the timeout question with a set_limit_time() but i am not sure where to put this line:...
0
7993
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8054
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6730
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5867
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5440
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2418
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1254
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.