Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3932228
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:26:04+00:00 2026-05-19T23:26:04+00:00

I have a e-mail driver. It get a list of e-mail accounts and receive

  • 0

I have a e-mail driver. It get a list of e-mail accounts and receive and store messages, it works fine. But the messages deletion, at last line, doesn’t works. Thats a part of code:

$arrPop3Config['host'] = $arrEmailconfiguracao['strPOPHost'];
$arrPop3Config['port'] = $arrEmailconfiguracao['intPOPPorta'];
$arrPop3Config['user'] = $arrEmailconfiguracao['strPOPUsuario'];
$arrPop3Config['password'] = $arrEmailconfiguracao['strPOPSenha'];
if($arrEmailconfiguracao['intAuth'] == '1') {
    $arrPop3Config['ssl'] = 'SSL';
} else if($arrEmailconfiguracao['intAuth'] == '2') {
    $arrPop3Config['ssl'] = 'TLS';
}

$objMail = new Zend_Mail_Storage_Pop3($arrPop3Config);

foreach($objMail as $intMensagemNum => $objMensagem) {

    $strMensagemUniqueId = $objMail->getUniqueId($intMensagemNum);
    $arrHeader = $objMensagem->getHeaders();
    $strRemetente = $objMensagem->getHeader('from', 'string');
    preg_match_all("/(.*)?<(.*)?>/", $strRemetente, $arrRemetente);
    $strRemetenteNome = $arrRemetente[1][0];
    $strRemetenteEmail = $arrRemetente[2][0];
    $strTitulo = $objMensagem->getHeader('subject', 'string');
    $objMensagemPart = $objMensagem;
    while ($objMensagemPart->isMultipart()) {
        $objMensagemPart = $objMensagem->getPart(1);
    }
    $strCorpo = $objMensagemPart->getContent();

    $objDb->call(
        'emailClienteRecebe'
        ,array(
            'intEmailconfiguracao' => $arrEmailconfiguracao['intId']
            ,'strMensagemUniqueId' => $strMensagemUniqueId
            ,'strRemetenteNome' => $strRemetenteNome
            ,'strRemetenteEmail' => $strRemetenteEmail
            ,'strHeaders' => serialize($arrHeader)
            ,'strTitulo' => $strTitulo
            ,'strCorpo' => $strCorpo
        )
    );


    $objMail->removeMessage($strMensagemUniqueId);

Php client return this message:

PHP Fatal error:  Uncaught exception 'Zend_Mail_Protocol_Exception' with message 'last request failed' in /var/www/maru/Maru/Zend/Mail/Protocol/Pop3.php:189
Stack trace:
#0 /var/www/maru/Maru/Zend/Mail/Protocol/Pop3.php(221): Zend_Mail_Protocol_Pop3->readResponse(false)
#1 /var/www/maru/Maru/Zend/Mail/Protocol/Pop3.php(457): Zend_Mail_Protocol_Pop3->request('DELE GmailId12d...')
#2 /var/www/maru/Maru/Zend/Mail/Storage/Pop3.php(227): Zend_Mail_Protocol_Pop3->delete('GmailId12de8345...')
#3 /var/www/maru/drivers/recebe-emails/driver.php(82): Zend_Mail_Storage_Pop3->removeMessage('GmailId12de8345...')
#4 {main}
  thrown in /var/www/maru/Maru/Zend/Mail/Protocol/Pop3.php on line 189

Apparently the pop command “DELE GmailId1283038051edcc6e” is the problem. However, using a common e-mail client, like mozilla thunderbird, i’ve monitorated sent commands e the same command works fine.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T23:26:04+00:00Added an answer on May 19, 2026 at 11:26 pm

    I know nothing about the Zend Pop3 client, only by looking at the online documentation.

    The POP3 specification has a DELE command, taking a message number. You are supplying a string!
    Therefore the server of course does not know what to do. The Zend POP3 method even states that the id supplied has to be of integer type in the removeMessage documentation.

    If you look at the getNumberByUniqueId documentation, you will see that you should translate the unique ID to a message number before calling removeMessage.

    Therefore, to fix your problem, you should replace your last line with:

    $objMail->removeMessage($objMail->getNumberByUniqueId($strMensagemUniqueId));
    

    And then I think everything will be fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented mail composer. But it opens mail composer whenever user had implemented
I have a e-mail address validator but I need to add special characters as
I have used java mail(com.sun.mail.smtp) from my struts project. Mail is sent successfully but
I have implemented mail Composer for iPhone and it's working Fine i want to
Let's say you have a mail client that stores messages, addresses etc. on the
I have mail server configuration data (server - user name - password - port)
I have this mail script I have to run a few times. To start
I have a mail webform where I have to show the user only (-1)
As part of the registration process on a website, I have added mail confirmation.
I have an e-mail template which is just a plain, static HTML page. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.